- · Bogo sort has an expected run time of O(n!); each time it randomly sorts our lists, i.e. picks one of the n!-many various permutations, and sees if this permutation happens to order our list (and there is exactly one of these permutations when our list is made of distinct integers.)
- · Bogo sort has a worst-case run time of O (1); as if we were quite terrifically unlucky it might never randomly pick the right permutation.
Vj Eric (Anime and Cosplay OtaKu) アニメ オタク X3"
All About The Hottest Anime and Cosplayer's All Over Asia X3
Eric Jeffrey Arriola
See my Official Page
Shout Out What Anime, Manga, And Cosplay Goddesses You Like Me To Add Up in
My Web Page ^.-,\/..
Saturday, December 10, 2011
Bogo sort algorithm VS. Stooge sort algorithm: which is better?
Bogo Sort and Stooge Sort
Algorithm is a list of instructions that explains how to do something.
BOGO SORT is one example of sorting algorithm. Its name comes from the word bogus. It is a terribly inefficient sorting algorithm that repeatedly generates a random permutation of the items until the items are in order. Another definition of bogo sort is that it is equivalent to repeatedly throwing a deck of cards in the air, picking them up at random, and then testing whether they are in order. This kind of sorting algorithm serves as a canonical example of awfulness. It is also known as the random sort, shotgun sort or monkey sort. This algorithm is use only for educational purposes, to contrast it with other more pragmatic algorithms. If bogo sort were used to sort a deck of cards, it would consist of checking if the deck were in order, and if it were not, one would throw the deck into the air, pick the cards up at random, and repeat the process until the deck is sorted.
These are the properties of bogo sort:
STOOGE SORT is another kind of sorting algorithm. This sorting algorithm is terribly inefficient sorting algorithm that swaps the top and bottom items if needed, then sorts the bottom two-thirds, then the top two-thirds, then the bottom two-thirds again. Its name comes from slapstick routines of the three (3) stooges in which each stooge hits the other two.
Comparing the two kinds of sorting algorithms they are both ineffective and humorous sorting algorithm. Bogo sort is a terribly inefficient sorting algorithm that repeatedly generates a random permutation of the items until the items are in order while Stooge sort is an algorithm that terribly inefficient sorting algorithm that swaps the top and bottom items if needed, then sorts the bottom two-thirds, then the top two-thirds, then the bottom two-thirds again. As I analyze the both algorithm, bogo sort is the better one.
by: Camille Abigail M. Rollan