+1 vote
in Data Structures & Algorithms II by (110k points)
The best case behaviour occurs for quick sort is, if partition splits the array of size n  into __________

(a) n/2 : (n/2) – 1

(b) n/2 : n/3

(c) n/4 : 3n/2

(d) n/4 : 3n/4

I have been asked this question during an interview.

The question is from Quicksort in chapter Sorting of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
 
Best 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.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...