Stupid sort (source code)

= Stupid sort
{wiki=Stupid_sort}

Stupid Sort is an intentionally inefficient and humorous sorting algorithm that serves more as a joke than a practical sorting method. The idea behind Stupid Sort is that it repeatedly shuffles the elements of an array or list until they happen to be sorted. Here’s a simple overview of how it works: 1. Check if the list is sorted. 2. If it is not sorted, randomly shuffle the elements of the list. 3. Repeat the check until the list is sorted.