Advertisements
Advertisements
Question
Consider the following unsorted list.
Neena Meeta Geeta Reeta Seeta
Sort the list using selection sort algorithm. Show the status of the list after every iteration.
Short Answer
Advertisements
Solution
Selection sort repeatedly places the alphabetically smallest name from the unsorted part in its correct position.
Initial list: [Neena, Meeta, Geeta, Reeta, Seeta]
| Iteration | Status of list |
|---|---|
| 1 | [Geeta, Meeta, Neena, Reeta, Seeta] |
| 2 | [Geeta, Meeta, Neena, Reeta, Seeta] |
| 3 | [Geeta, Meeta, Neena, Reeta, Seeta] |
| 4 | [Geeta, Meeta, Neena, Reeta, Seeta] |
Sorted list: [Geeta, Meeta, Neena, Reeta, Seeta]
shaalaa.com
Is there an error in this question or solution?
