Programming chalenge: Bogosort
-
I prefer this[^] sorting algorithm myself.
Software Zen:
delete this;
Fold With Us![^]Why, I outta...........!
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
-
Dude, haven't you heard? The best sorting is probably found in Qt!!!
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow
Jim Crafton wrote:
The best sorting is probably found in Qt!!!
:-D And I bet it is twice as efficient as bogosort.
-
Why, I outta...........!
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
Woo-woo-woo!
Software Zen:
delete this;
Fold With Us![^] -
Just learned about the best sorting algorithm ever: Bogosort[^] Here is my implementation in C++ (note use of C++0x
is_sorted
algorithm):template <class RandomAccessIterator, class Compare>
void bogo_sort (RandomAccessIterator first, RandomAccessIterator last, Compare comp)
{
while (!is_sorted(first, last, comp))
random_shuffle(first, last);
}Most guys would tell you the QuickieSort is the fastest.
-
Just learned about the best sorting algorithm ever: Bogosort[^] Here is my implementation in C++ (note use of C++0x
is_sorted
algorithm):template <class RandomAccessIterator, class Compare>
void bogo_sort (RandomAccessIterator first, RandomAccessIterator last, Compare comp)
{
while (!is_sorted(first, last, comp))
random_shuffle(first, last);
} -
Dude, haven't you heard? The best sorting is probably found in Qt!!!
¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow
:-D
-
FILETIME to time_t
| FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy -
Just learned about the best sorting algorithm ever: Bogosort[^] Here is my implementation in C++ (note use of C++0x
is_sorted
algorithm):template <class RandomAccessIterator, class Compare>
void bogo_sort (RandomAccessIterator first, RandomAccessIterator last, Compare comp)
{
while (!is_sorted(first, last, comp))
random_shuffle(first, last);
} -
Is this a spoon I see before me?
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
Perhaps it is a spoony bard?