How does Quick Sort divide the array during its partitioning step?

  • It compares every element with a randomly chosen pivot
  • It moves elements in a zigzag pattern based on their values
  • It randomly rearranges elements in the array
  • It selects a pivot element and partitions the array into two sub-arrays such that elements smaller than the pivot are on the left, and larger elements are on the right
Quick Sort divides the array by selecting a pivot, placing smaller elements to its left and larger elements to its right. This process is repeated recursively for the sub-arrays, leading to a sorted result.
Add your answer
Loading...

Leave a comment

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