Let's take a look at the quick sort algorithm in action step by step:
Given the [3, 5, 1, 6, 4, 7, 2] array, the preceding diagram represents the first execution of the partition operation.
The following diagram exemplifies the execution of the partition operation for the first subarray of lower values (note that 7 and 6 are not part of the subarray):
Next, we will continue creating subarrays, as seen in the following diagram, but now with greater values than the subarray of the preceding diagram (the lower subarray ...