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.
Q. Which is the worst method of choosing a pivot element?
β
Correct Answer: (A)
first element as pivot
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.
Discussion
Question Analytics
737
Total Visits
2 y ago
Published
Mr. Dubey
Publisher
84%
Success Rate