Combsort is far more elegant and faster
algorithm. I've wrote a type-generic combsort
a while ago here:
https://github.com/FrozenVoid/combsort.h
(Combsort as well as mentioned algorithm also consists of two loops and a swap)
(Combsort as well as mentioned algorithm also consists of two loops and a swap)