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

Sort the following list using selection sort algorithm H, V, A, T, L, N, K

Sort the following list using selection sort algorithm H, V, A, T, L, N, K What is the output of the algorithm after 3rd pass?
  1. AA, V, H, T, L, N, K
  2. BA, H, K, T, L, N, V
  3. CA, V, T, H, L, N, K
  4. DA, T, H, K, L, N, V
Show answerHide answer

Correct answer: (B) A, H, K, T, L, N, V

Explanation

Pass 1 swaps A with H: A, V, H, T, L, N, K. Pass 2 swaps H with V: A, H, V, T, L, N, K. Pass 3 swaps K with V: A, H, K, T, L, N, V.

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

This is question 69 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.