Home / Engineering / Design and Analysis of Algorithms / Question

M

Mr. Dubey • 51.43K Points
Coach

Q.) What is the number of swaps required to sort the array arr={5,3,2,4,1} using recursive selection sort?

(A) 0
(B) 1
(C) 2
(D) 3
Correct answer : Option (C) - 2

Explanation:
 the first swap takes place between 1 and 5. the second swap takes place between 3 and 2 which sorts our array.

Share

Discusssion

Login to discuss.