Bogosort is my favorite sorting algorithm. Its idea is simple. Take the things you want to sort, randomly shuffle them, and then check to see if they're sorted. I'm gonna show you how once your set of to-be-sorted objects gets "large" enough (i.e. the size of a standard deck of cards), the probabilistic guarantees of Bogosort render it only useful to those with either
- A serious amount of faith, or
- A serious gambling problem.