Week12Activity.html
Bogo Sort is a sorting algorithm that generates many permutations of an input until it finds a permutation that is correctly sorted. For example, an array of numbers that should be in ascneding order. Bogo sort will create many different permutations of this array until it stumbles on an array that is correct. This sorting algorithm is definitely not useful but it is very fun!
The pseudocode for this algorithm is essentially: while (not sorted(object)){ shuffle(object) }
The actual time complexity for this method is unknown as there is no real way to accurately gauge when this method will return an ordered array.
As seen in this image, there is no set way each element moves, they are moved around randomly until they are put it into the correct order at some point. For an array like this it took less than 3 attempts, but it could also take more than 300 on another test with this exact same array.
Here is a webpage going into more detail about BogoSort