Question discussion

Sort the following list using selection sort algorithm.H, V, A, T, L, N, KWhat is the output of the algorithm after 3rd pass?

5237Medium DSSSB TGT Computer Science 0 replies 0 views
0
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?
  • AA, V, H, T, L, N, K
  • BA, H, K, T, L, N, V
  • CA, V, T, H, L, N, K
  • DA, T, H, K, L, N, V
Correct answer: B

Explanation

Selection sort: pass 1 → A, V, H, T, L, N, K; pass 2 → A, H, V, T, L, N, K; pass 3 → A, H, K, T, L, N, V.

Discussion 0

Nobody has replied yet. Start the discussion!