Question discussion

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…

5195Medium DSSSB TGT Computer Science 0 replies 0 views
0
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?
  • A21, 37, 54, 12, 9, 57, 68, 85
  • B37, 21, 54, 68, 12, 9, 57, 85
  • C21, 37, 12, 9, 54, 57, 68, 85
  • D21, 12, 9, 37, 54, 57, 68, 85
Correct answer: A

Explanation

Pass 1: 37, 21, 54, 68, 12, 9, 57, 85. Pass 2: 21, 37, 54, 12, 9, 57, 68, 85.

Discussion 0

Nobody has replied yet. Start the discussion!