1.

Which of the following is not true about library sort?(a) it uses binary search and insertion sort in its implementation(b) gaps are created between successive elements in order to ensure faster insertion(c) array needs to be re balanced after every insertion(d) it is an in place sorting algorithmI have been asked this question by my college professor while I was bunking the class.Query is from Sorting in portion Sorting of Data Structures & Algorithms II

Answer»

Right choice is (d) it is an in PLACE sorting algorithm

Easy EXPLANATION - Library sort is not an in place sorting algorithm as it requires O(n) auxiliary SPACE. The array needs to be re balanced after every insertion so as to ensure that GAPS are present between every successive element.



Discussion

No Comment Found

Related InterviewSolutions