What if Indexes in Hoare's Quick Sort Algorithm Both Land on Values Less than Pivot?
You've misunderstood the algorithm and it doesn't have the behaviour you suggest.

Let the pivot value be&nbsp;$p$. The algorithm searches from the left for a value $\ell\geq p$ and from the right for a value $r\leq p$. It then only swaps them if they're in the wrong order relative to each other, i.e., if $\ell&gt;r$, so it will never exchange two identical array elements.

In your example, the algorithm would either swap the 1 on the left with the 7 on the right, or the 7 on the left with the 1 on the right, depending on exactly how it is implemented.