+1 vote
in Data Structures & Algorithms II by (110k points)
What is the purpose of using randomized quick sort over standard quick sort?

(a) so as to avoid worst case time complexity

(b) so as to avoid worst case space complexity

(c) to improve accuracy of output

(d) to improve average case time complexity

This question was addressed to me during an interview for a job.

My question is from Sorting topic in portion Sorting of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
Best answer
Right choice is (a) so as to avoid worst case time complexity

To explain: Randomized quick sort helps in avoiding the worst case time complexity of O(n2) which occurs in case when the input array is already sorted. However the average case and best case time complexities remain unaltered.

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.