πŸ“Š Design and Analysis of Algorithms
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
πŸ’¬ Discuss
βœ… Correct 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.


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