Sort the following elements using Bubble sort in ascending order. What is the intermediate sequence of 37, 54, 21, 85, 68, 12, 9, 57 after second pass?
Show answerHide answer
Correct answer: (C) 21, 37, 54, 12, 9, 57, 68, 85
Explanation
Pass 1 moves 85 to the end: 37, 21, 54, 68, 12, 9, 57, 85. Pass 2 moves 68 to its place: 21, 37, 54, 12, 9, 57, 68, 85.