#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[]){
int cnt=12;
srand(time(NULL));
cout<<'\n'<<endl;
cout<<"sorting ints example\ninput : ";
for (int i=0;i<cnt;i++)
cout<<endl;
cout<<"output : ";
cout<<'\n'<<endl;
cout<<"sorting strings example\ninput : ";
for (int i=0;i<cnt;i++){
string *tempS=new string(randomStrGen(4));
cout<<*tempS<<'\t';
hts.
add(tempS, &string::compare);
}
cout<<endl;
hts.
sort(&string::compare);
cout<<"output : ";
cout<<'\n'<<endl;
cout<<"sorting strings LinkList example\ninput : ";
for (int i=0;i<cnt;i++){
string *tempS=new string(randomStrGen(4));
cout<<*tempS<<'\t';
}
cout<<endl;
hts.
sort(ll, &string::compare);
cout<<"output : ";
cout<<endl;
return 0;
}