Look at the C standard qsort function. You don't need to write a sort algorithm yourself. qsort will sort anything, even horrible string classes.
Look at the C standard qsort function. You don't need to write a sort algorithm yourself. qsort will sort anything, even horrible string classes.
#include<algorithm>
vector<string> vec_name;
string x;
//get input from user for example
while (cin >> x)
vec_name.push_back(x);
sort(vec_name.begin(), vec_name.end() );
The speed is nlog(n)
It might not work in MSVC++6 because that compiler doesn't meet the C++ standard.
apstring isn't that bad. It provides the subset of the most useful functions in std::string.
I nominate bogo-sort definition as most humorous post. Well done!!!
>I nominate bogo-sort definition as most humorous post.
If you stick around long enough you could probably build a library of theories for quantum bogodynamics simply by reading some of the code posted on these boards.
[anticipation]
[/anticipation]quantum bogodynamics /kwon'tm boh`goh-di:-nam'iks/ n.
A theory that characterizes the universe in terms of bogon sources (such as politicians, used-car salesmen, TV evangelists, and suits in general), bogon sinks (such as taxpayers and computers), and bogosity potential fields. Bogon absorption, of course, causes human beings to behave mindlessly and machines to fail (and may also cause both to emit secondary bogons); however, the precise mechanics of the bogon-computron interaction are not yet understood and remain to be elucidated. Quantum bogodynamics is most often invoked to explain the sharp increase in hardware and software failures in the presence of suits; the latter emit bogons, which the former absorb. See bogon, computron, suit, psyton.
-Prelude
My best code is written with the delete key.