1. Computer Science Engineering (CSE)
  2. Design and Analysis of Algorithms
  3. Which is the worst method of choosing a ...
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
Answer» A. first element as pivot
Explanation: 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.

Discussion