1.

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 inputI got this question in an interview.This is a very interesting question from Sorting in section Sorting of Data Structures & Algorithms II

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.



Discussion

No Comment Found

Related InterviewSolutions