Hand test selection sort with array of numbers 4, 71, 32, 19, 61, 2, -5 in descending order.

Answers

This answer is not selected as best answer. This answer may not be sufficient for exam.

Your limit has been exceed. We have implemented this system because, We got difficulty on managing our servers. Please donate some amount to remove this limit.

Quota: 0 / 30

Donate

Given data are

4 71 32 19 61 2 -5

Now, for the first position in the sorted array, the entire array is to be scanned sequentially.

At present, 4 is stored at the first position, after searching the entire array, it is found that 71 is the largest value.

So, swap 4 with 71. After the first iteration, 71 will appear at the first position in the sorted array.

71 4 32 19 61 2 -5

The same process is applied to the rest of the array elements.

71 4 32 19 61 2 -5
71 61 32 19 4 2 -5

 

 

If you found any type of error on the answer then please mention on the comment or submit your new answer.
Leave your Answer:

Click here to submit your answer.

Discussion
0 Comments
  Loading . . .