M

Mr. Dubey • 52.66K Points
Coach

Q. Which is the worst method of choosing a pivot element?

(A) first element as pivot
(B) last element as pivot
(C) median-of-three partitioning
(D) random element as pivot
Share

Explanation by: Mr. Dubey
 choosing the first element as pivot is the worst method because if the input is pre-sorted or in reverse order, then the pivot provides a poor partition.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Loading Comments....

Question analytics