1.

The best case behaviour occurs for quick sort is, if partition splits the array of size ninto __________(a) n/2 : (n/2) – 1(b) n/2 : n/3(c) n/4 : 3n/2(d) n/4 : 3n/4I have been asked this question during an interview.The question is from Quicksort in chapter Sorting of Data Structures & Algorithms II

Answer»

Right choice is (a) n/2 : (n/2) – 1

The best I can EXPLAIN: The best case analysis of quick sort occurs when the PARTITION SPLITS the array into two subarrays, each of size no more than n/2 SINCE one is of size n/2 and one of size (n/2) – 1.



Discussion

No Comment Found

Related InterviewSolutions