评论antognini · 2021-10
“Bogosort is pretty simple, too. while not is_sorted(a) do shuffle(a) However the shuffle function hides a surprising amount of complexity. It is nontrivial to write a correct shuffle function. [1] But Bogosort isn't even the worst sorting algorithm out there! There is also Worstsort [2]. [1]: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle…”