retagged by
691 views
0 votes
0 votes
which of the following methods will be the best if number of swappings done, is the only measure of efficiency?

A) Bubble sort             B) Selection sort

C) Insertion sort           D) Quick sort
retagged by

1 Answer

Best answer
1 votes
1 votes
Answer is selection sort. In worst case only O(n) swaps. Also in best and average case no other method can have less number of swaps then selection sort.
selected by

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
2
Sambhrant Maurya asked Aug 7, 2018
542 views
If given numbers are 12,7,15,8,19,20,17,21,5,3 in _______ passes of quick sort element 5 will be in sorted position. (Considering last element as pivot)