1.

What is the cut-off for switching from quick sort to insertion sort in the implementation of introsort?(a) 4(b) 8(c) 16(d) 32The question was posed to me in an interview for job.Question is from Sorting topic in chapter Sorting of Data Structures & Algorithms II

Answer» RIGHT option is (c) 16

For explanation: When small ARRAYS needs to be sorted then INSERTION sort proves to be the best choice. So when the size of the partition is less than 16 INTROSORT switches to insertion sort. This particular value has been deduced EXPERIMENTALLY.


Discussion

No Comment Found

Related InterviewSolutions