> Technically the first pass will ensure that the smallest element ends up at position 0 even if it's looked at more times
Read it again; First pass ensures that the largest element ends up in position 0. Yet it somehow manages to sort ascending by the end.
It's not very intuitive and it's probably the least efficient sorting algorithm I've seen besides sleepsort[1]
[1]: https://www.reddit.com/r/programminghorror/comments/lgsd18/i...