English

Consider the following unsorted list 90 78 20 46 54 1 Write the list after: a. 3rd iteration of selection sort b. 4th iteration of bubble sort c. 5th iteration of insertion sort

Advertisements
Advertisements

Question

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
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?
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 13. | Page 104
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×