1.

Which of the following sorting algorithm will be preferred when the size of partition is between 16 and 2 log(n) while implementing introsort?(a) quick sort(b) insertion sort(c) heap sort(d) merge sortThe question was asked by my school principal while I was bunking the class.Origin of the question is Sorting topic in section Sorting of Data Structures & Algorithms II

Answer»

The correct answer is (a) quick sort

Easiest explanation - Quicksort proves to be the best sorting ALGORITHM for mid SIZED arrays as it has low space and time COMPLEXITY. Thus quick sort is preferred when size of PARTITION is between 16 and 2 log(N).



Discussion

No Comment Found

Related InterviewSolutions