Q. What is the main purpose of the partitioning step in Quick Sort?
A.
To merge two sorted arrays
B.
To find the median
C.
To rearrange elements around a pivot
D.
To build a heap
Solution
The partitioning step in Quick Sort rearranges elements around a pivot to ensure that elements less than the pivot are on one side and those greater are on the other.
Correct Answer:
C
— To rearrange elements around a pivot