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?
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.