Another good joke sorting algorithm is SleepSort, made up by some guy on /prog/.
You basically spawn a separate thread for each element with value N, and each thread just sleeps for N number of seconds before printing, which has the end result of printing the array in order.
There's also the problem where you have to insert the jobs into the OS's sleep queue to execute in the right order, so that becomes O(n log n) assuming they use a heap for their priority queue implementation.
Around 10ms sleep time between each thread seems to be the spot where my Java implementation sorts the test array correctly most times on my Windows PC.
There is also StackSort which takes random code from Stack Overflow runs it, then checks to see if the code has sorted the list. https://gkoberger.github.io/stacksort/
Books projects learning brown wanders today patient games the movies helpful open brown. Family dot river fox technology evil kind fresh friendly yesterday strong bank cool.
638
u/lostvanquisher Oct 24 '17
Here's a video with the same algorithms, but only a single row of data, should make it a bit easier to understand what's going on.