Acme-Sort-Bozo
view release on metacpan or search on metacpan
lib/Acme/Sort/Bozo.pm view on Meta::CPAN
guarantee that any particular sort will come in anywhere near average. Where the bogosort is a 'stateless'
sort, the bozo sort maintains a list state from one iteration to the next, but its decision mechanism for swaps I<is>
stateless; it blindly swaps any random two elements.
Keep in mind that a list of five items consumes an average of 5 * 5!, or 600 iterations. 10! is
36,288,000 iterations on average. The universe will either collapse or expand to the point that it cannot sustain
life long before the Bozo sort manages to sort a deck of cards, in the average case. In the worst case, all of the
background radiation from our universe will have decayed to the point that there is no longer any trace of our
existence before this sort manages to alphabetically sort your social networking friends list.
Test with short (4 to 7 element) lists, and be prepared to kill the process if you mistakenly hand it more elements
than that.
=head1 EXPORT
Always exports one function: C<bozo()>.
=head1 SUBROUTINES/METHODS
=head2 bozo( @unsorted )
( run in 0.241 second using v1.01-cache-2.11-cpan-8d75d55dd25 )