+1 vote
in Data Structures & Algorithms II by (110k points)
What is a randomized quick sort?

(a) quick sort with random partitions

(b) quick sort with random choice of pivot

(c) quick sort with random output

(d) quick sort with random input

I got this question in an interview.

This is a very interesting question from Sorting in section Sorting of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
 
Best answer
Correct choice is (b) quick sort with random choice of pivot

The best I can explain: Randomized quick sort chooses a random element as a pivot. It is done so as to avoid the worst case of quick sort in which the input array is already sorted.

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

...