Inspiration
Love for Data Structures, Algorithms, Python, and MLH INIT.
What it does
The monkey sort works somewhat like what an actual monkey would do if it is asked to sort a given set of (let's say) cards. It will just throw all the cards in the air and let them fall. Upon falling, it may check whether the cards have fallen in a sorted manner or not. If they are sorted, it will just return it, otherwise it will continue repeating the same process. Needless to say, this is a highly inefficient sorting technique, but it indeed exists, and so I think it can be demonstrated along with the other sorting algorithms just for some fun!
How I built it
I have implemented the sorting-technique in Python Programming Language.
Challenges I ran into
The worst statistics of Time-Complexity:
Worst time complexity: Infinite
Average time complexity: n x n!
Best time complexity: n
What I learned
A new and fun sorting algorithm!
What's next for Monkey-Sort
A better sorting technique with a better time-complexity maybe?
Log in or sign up for Devpost to join the conversation.