Take the description from Wikipedia:
- Pick an element, called a pivot, from the array.
- Partitioning: reorder the array so that all elements with values less than the pivot come before the pivot, while all elements with values greater than the pivot come after it (equal values can go either way). After this partitioning, the pivot is in its final position. This is called the partition operation.
- Recursively apply the above steps to the sub-array of elements with smaller values and separately to the sub-array of elements with greater values.
Since neither of the sub-arrays includes the pivot, the same element can't be selected as the pivot for the recursive calls. So it can only be a pivot once.
If you have multiple equal elements in the original array, they can all be used as a pivot.