This means that elements that are equal will not be swapped.
Let's consider the example qsort $[2,2,3,1,1]$.
In the original definition, the first step would be to choose a pivot element, let's say 2. Then we would partition the list into two sublists: one with
Show more…