English

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.

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?
Chapter 5: Liner List Manipulation - EXERCISE [Page 104]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 5 Liner List Manipulation
EXERCISE | Q 12. | Page 104
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×