Bars partitioned around a taller amber pivot bar, with shorter unsorted bars on the left and taller ones on the right, illustrating quicksort partitioning

Quicksort Algorithm — Lomuto vs Hoare, With Code in C, C++, Java, Python and C#

On 5,000 sorted values a last-element pivot makes 12.5 million comparisons instead of 67,000. Quicksort, measured — with code in five languages.