How does Quick Sort select the pivot element in its partitioning process?

  • Always chooses the middle element
  • Picks the largest element
  • Randomly from the array
  • Selects the first element
Quick Sort selects the pivot element randomly from the array during its partitioning process. This random selection helps avoid worst-case scenarios and improves the average performance of the algorithm.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *