1. Computer Science Engineering (CSE)
  2. Design and Analysis of Algorithms
  3. What is the number of swaps required to ...
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
Answer» 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.

Discussion