To implement the quicksort algorithm, we can use various approaches to choosing the pivot, as well as apply different partition schemes. As an example, let's consider the following array:
{ 18, 3, 15, 5, 14, 12, 11, 11, 15, 17, 19 }
If we choose the fourth element (which is ) as the pivot, a possible partition will look as follows:
{ 3, 5, 18, 15, 14, 12, 11, 11, 15, 17, 19 }
The elements at the right of the pivot can be rearranged in any order, and it will still remain a correct partition for this pivot.
Given below is a collection of four arrays and pivots. Match each of the pivots with an array that corresponds to a correct partition for this pivot.