Programming chalenge: Bogosort
-
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?