News for hackers. Stuff that matters.
Re: by Jaxan on Sunday November 05, 2023 @06:06AM (#38150067)
It seems to only work for a fixed size. Wouldn’t that be called a sorting network?
Re: by pzmarzly on Sunday November 05, 2023 @06:11AM (#38150091)
It is a sorting network corresponding to bubble sort on 5-element input.

It is actually pretty good - the code uses 10 comparisons, while the optimal sorting network for 5 elements uses 9: https://bertdobbelaere.github.io/sorting_networks.html#N5L9D...

Re: by Jaxan on Sunday November 05, 2023 @07:21AM (#38150503)
That’s a cool page! Thanks!