Q&A CBSE12A-2015-B03A #6362
Question:
What will be the status of the following list after fourth pass of bubble sort and fourth pass of selection sort used for arranging the following elements in descending order ?
34,6,12,3,45,25
Answer:
Bubble Sort 34,6,12,3,45,25 (Original Content)
i. 34,12,-3,45,25,-6
ii. 34,12,45,25,-3,-6
iii. 34,45,25,12,-3,-6
iv. 45,34,25,12,-3,-6
Selection Sort 34,6,12,3,45,25 (Original Content)
i. 45,-6,12,-3,34,25
ii. 45,34,12,-3,-6,25
iii. 45,34,25,-3,-6,12
iv. 45,34,25,12,-6,-3
(Unsorted status after 4th pass)
