#include #include #include #include using namespace std; int random_in_range(int a, int b) { return a+random()%(b-a+1); } char random_letter() { static string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int pos = random_in_range(0, alphabet.length()-1); return alphabet[pos]; } string random_string() { int length = random_in_range(3,12); string result = ""; for (int i=0; ib) return true; else if (a0; j--) { if (compare(A[j],A[j-1])==false) { swap(A[j],A[j-1]); } } } } void bubble_sort(string A[], int size) { for (int i=size; i>0; i--) { for (int j=0; j> size; cout << "\n"; string data[size]; randomize(data,size); for (int i=0; i> sort; cout << "\n"; starttime = getcputime(); if (sort=="Insertion" || sort=="insertion") insertion_sort(data,size); else if (sort=="Selection" || sort=="selection") selection_sort(data,size); else if (sort=="Bubble" || sort=="bubble") bubble_sort(data,size); endtime = getcputime(); for (int i=0; i