+3 votes
in Class 12 by kratos

Consider the following unsorted list: 90 78 20 46 54 1 Write the list after:

  1. 3rd iteration of selection sort

  2. 4th iteration of bubble sort

  3. 5th iteration of insertion sort Ans. Working :

1 Answer

+5 votes
by kratos
 
Best answer

Working:

| Bubble Sort | Selection Sort | Insertion Sort |
| [1,90,78,46,54,20] | [1,78,20,46,54,90] | [78,90,20,46,54,1 |
| [1,20,90,78,54,46] | [1,20,78,46,54,90] | [20,78,90,46,54,1] |
| [1,20,46,90,78,54] | [1,20,46,78,54,90] | [20,46,78,90,54,1] |
| [1,20,46,54,90,78] | [1,20,46,54,78,90] | [20,46,54,78,90,1] |
| [1,20,46,54,78,90] | [1,20,46,54,78,90] | [1,20,46,54,78,90] |
| [1,20,46,54,78,90] | [1,20,46,54,78,90] | |

  1. 3rd iteration of selection sort: [1,20,46,78,54,90]

  2. 4th iteration of bubble sort: [1, 20, 46, 54, 90, 78]

  3. 5th iteration of insertion sort: [1, 20, 46, 54, 78, 90]

...