bogo sort is a term that means a perversely awful sorting algorithm, rather than a real sorting mechanism.
sometimes people will describe a particular (usually random) "sort" implementation and claim it as bogo-sort.
often this involves swapping a random pair of entries in the list to be sorted and checking to see if the list is now sorted, and if not, repeating the process.
a spectacular variant of bogo-sort has been proposed which has the interesting property that, if the Many Worlds interpretation of quantum mechanics is true, it can sort an arbitrarily large array in constant time. (In the Many-Worlds model, the result of any quantum action is to split the universe-before into a sheaf of universes-after, one for each possible way the state vector can collapse; in any one of the universes-after the result appears random.) The steps are: 1. Permute the array randomly using a quantum process, 2. If the array is not sorted, destroy the universe. Implementation of step 2 is left as an exercise for the reader.
Im lookin for the source code for bogo sort in c++ can any one help??
Here is a C implementation
customer satisfaction survey
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment