+1 vote
in Data Structures & Algorithms II by (110k points)
Which of the following methods is the most effective for picking the pivot element?

(a) first element

(b) last element

(c) median-of-three partitioning

(d) random element

The question was posed to me by my college director while I was bunking the class.

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

1 Answer

+1 vote
by (614k points)
selected by
Best answer
Correct option is (c) median-of-three partitioning

Explanation: Median-of-three partitioning is the best method for choosing an appropriate pivot element. Picking a first, last or random element as a pivot is not much effective.

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.