Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (A) choosing a random element as pivot
Explanation: this is the safest method to choose the pivot element since it is very unlikely that a random pivot would consistently provide a poor partition.

Explanation by: Mr. Dubey
this is the safest method to choose the pivot element since it is very unlikely that a random pivot would consistently provide a poor partition.

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
938
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
91%
Success Rate