1.

Which of the following is an adaptive sorting algorithm?(a) library sort(b) merge sort(c) heap sort(d) selection sortI have been asked this question in a job interview.I'm obligated to ask this question of Sorting in chapter Sorting of Data Structures & Algorithms II

Answer»

Right OPTION is (a) library sort

Easiest explanation - Library sort is an adaptive algorithm. It is because the TIME complexity of the algorithm improves when the INPUT array is ALMOST sorted.



Discussion

No Comment Found

Related InterviewSolutions