Question 8Asked in DSSSB TGT Computer Science (Technical), 7 Aug 2021, Shift 3

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?

  1. A21, 37, 12, 9, 54, 57, 68, 85
  2. B37, 21, 54, 68, 12, 9, 57, 85
  3. C21, 37, 54, 12, 9, 57, 68, 85
  4. D21, 12, 9, 37, 54, 57, 68, 85
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.

From DSSSB TGT Computer Science PYQ (Technical), 7 Aug 2021, Shift 3

This is question 8 of DSSSB TGT Computer Science PYQ (Technical), 7 Aug 2021, Shift 3. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.