It might indeed be the best algorithm for common cases of this specific problem, but there needs to be a fallback when either the input is large or a lot of swaps are being done since otherwise it&#x27;s O(n^2).<p>Interesting that other people pointed this out, yet he apparently committed the code anyway.