Which is the safest method to choose a pivot element?
(a) choosing a random element as pivot
(b) choosing the first element as pivot
(c) choosing the last element as pivot
(d) median-of-three partitioning method
I got this question in an internship interview.
Question is taken from Quicksort topic in section Sorting of Data Structures & Algorithms II