Question 14958 – DSSSB TGT 2017
February 20, 2024
Question 11772 – Sorting
February 20, 2024
Question 14958 – DSSSB TGT 2017
February 20, 2024
Question 11772 – Sorting
February 20, 2024

GATE 2006

Question 14

Which one of the following in place sorting algorithms needs the minimum number of swaps?

A
Quick sort
B
Insertion sort
C
Selection sort
D
Heap sort
Question 14 Explanation: 
Selection sort requires minimum number of swaps i.e O(n). The algorithm finds the minimum value, swaps it with the value in the first position, and repeats these steps for the remainder of the list. It does no more than n swaps, and thus is useful where swapping is very expensive.
Correct Answer: C
Question 14 Explanation: 
Selection sort requires minimum number of swaps i.e O(n). The algorithm finds the minimum value, swaps it with the value in the first position, and repeats these steps for the remainder of the list. It does no more than n swaps, and thus is useful where swapping is very expensive.

Leave a Reply

Your email address will not be published. Required fields are marked *