#include <math.h>
#include <time.h>
string randomStrGen(int length) {
static string charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
result.resize(length);
for (int i = 0; i < length; i++)
result[i] = charset[rand() % charset.length()];
}
int findRand(int cnt){
int r=(int)
round((
float)(rand()-RAND_MAX/2)*2.0/(
float)RAND_MAX*(float)cnt);
return r;
}
int main(
int argc,
char *argv[]){
srand(time(NULL));
int cnt=10;
cout<<"want to sort the following :"<<endl;
for (int i=0;i<cnt;i++){
string *tempS=new string(randomStrGen(4));
cout<<*tempS<<'\t';
}
cout<<endl;
bst.
sort(&linkList, &string::compare);
cout<<"The result is :"<<endl;
for (
int i=1; i<=linkList.
getCount(); i++)
cout<<(*linkList.
next())<<
'\t';
cout<<endl;
return 0;
}