wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

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

A
Quicksort
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
Insertion sort
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Selection sort
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
Heap sort
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C Selection sort
In selection sort, minimum number of swaps taken compared to other sorting techniques.
Number of swaps = O(n)
Number of comparisons = O(n2)
In finds the minimum of the subarray and exchanges only once in every pass.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Remainder Problems
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon