Factorial Tree Sort reads an array of integers and randomly arranges the order of those integers. It then checks to see if the array is sorted, if the array is sorted, Factorial Tree Sort has done its job. If the array is not sorted
I just did a coctothorpian implementation of this to prove that it will in fact not work. The pseudorandom numbers generated to select movement patterns eventually wrap in such a way that it will rarely, if ever, reach the state of being fully sorted.
>>44
Reinitialize your generator with a clock seed each iteration.
Name:
Anonymous2011-06-03 14:42
I figured out a better algorithm! Try all possible solutions once! That way the solution will be definitely found if it exists.
Where's my Nobel prize?
derpSort :: (Ord a) => [a] -> [a]
derpSort = head.filter isSorted.permutate
Works very quickly for already sorted or mostly sorted lists. However, insanely slow on completely unsorted lists