हिंदी

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

Advertisements
Advertisements

प्रश्न

______ is an algorithm that requires minimum number of swaps.

विकल्प

  • Insertion sort

  • Quick sort

  • Heap sort

  • Selection sort

MCQ
रिक्त स्थान भरें

उत्तर

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
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×