Integers as input and outputs two numbers P and Q, and produces three partitions of A as shown.
My Partition:
Partition 1: A[i] < X, L < i < P
Partition 2: A[i] = X, P ≤ i ≤ Q
Partition 3: A[i] > X, Q < i < R
In case of only one number in the middle partition, P = Q.
Write a Divide-and-Conquer algorithm, my_sort(A[L.R]), which makes use of my_partition and sorts the array A[0 .. N-1].