Advertisements
Advertisements
Question
Consider the following unsorted list
90 78 20 46 54 1
Write the list after:
- 3rd iteration of selection sort
- 4th iteration of bubble sort
- 5th iteration of insertion sort
Short Answer
Advertisements
Solution
Initial list: [90, 78, 20, 46, 54, 1]
| Sorting method and iteration | List status |
|---|---|
| (a) Selection sort — 3rd iteration | [1, 20, 46, 78, 54, 90] |
| (b) Bubble sort — 4th iteration | [20, 1, 46, 54, 78, 90] |
| (c) Insertion sort — 5th iteration | [1, 20, 46, 54, 78, 90] |
shaalaa.com
Is there an error in this question or solution?
