3 ms·
The entire point of quicksort is that it doesn't allocate and its inner loop is very tight (especially if you don't use Lomuto partitioning -- they teach Lomuto
by qsort 3y ago
The entire point of quicksort is that it doesn't allocate and its inner loop is very tight (especially if you don't use Lomuto partitioning -- they teach Lomuto partitioning in school because the proof of correctness is easier).
Writing it in the naive functional-like style is fun and instructive, but it doesn't quite strike at the heart of what quicksort is about.
It's an example of an instance where the functional setting makes it harder to reason about the program.