Comment Comment by antognini 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[2]: https://arxiv.org/abs/1406.1077 parent antognini 5 years ago
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
[2]: https://arxiv.org/abs/1406.1077