English

______ is an algorithm that requires minimum number of swaps. -

Advertisements
Advertisements

Question

______ is an algorithm that requires minimum number of swaps.

Options

  • Insertion sort

  • Quick sort

  • Heap sort

  • Selection sort

MCQ
Fill in the Blanks

Solution

Selection sort is an algorithm that requires minimum number of swaps.

Explanation:

Selection sort is an in place method that requires the fewest swaps since we constantly chose the smallest element and place it in the proper location, therefore the total number of swaps is n-1 in the worst case. As a result, selection sort performs the fewest swaps when compared to other algorithms.

shaalaa.com
Selection Sort
  Is there an error in this question or solution?
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×