Use Selection Sort to sort the following sequence of six numbers into descending order. Show the result of each step by displaying the whole sequence on a new line with sorted numbers underlined.

Initial sequence: 128, 242, 202, 150, 172, 134

1. First pass: 242, 128, 202, 150, 172, 134
2. Second pass: 242, 202, 128, 150, 172, 134
3. Third pass: 242, 202, 172, 128, 150, 134
4. Fourth pass: 242, 202, 172, 150, 128, 134
5. Fifth pass: 242, 202, 172, 150, 134, 128

Final sorted sequence: 242, 202, 172, 150, 134, 128

Answer :

Final answer:

Explanation of sorting numbers using Selection Sort in descending order with step-by-step examples.

Explanation:

To sort the numbers in descending order using Selection Sort, we would start by selecting the largest element and placing it in the last position. Then, we would repeat this process for the remaining elements to sort the list.

  1. Step 1: 128 1 2 3 4 5 242 202 150 172 134
  2. Step 2: 128 242 2 3 4 5 1 202 150 172 134
  3. Step 3: 128 242 202 3 4 5 1 2 150 172 134
  4. Step 4: 128 242 202 172 4 5 1 2 3 150 134
  5. Step 5: 128 242 202 172 150 5 1 2 3 4 134
  6. Step 6: 128 242 202 172 150 134 1 2 3 4 5