#include "hw5-types.h" /* for types in arrays and compare function */ /* * Function: NumOfSorts * Usage: n = NumOfSorts(); * --------------------------- * Returns the number of sorts implemented in SortName and Sort */ int NumOfSorts(void); /* * Function: SortName * Usage: name = SortName(sortNum); * ----------------------------------- * if 0 <= sortNum < NumOfSorts(), then SortName returns the name of * sort number sortNum. Else it returns the value "No Sort Performed". * Note: counting starts at 0 as per usual C conventions. */ char* SortName(int sort); /* * Function: Sort * Usage: Sort(sortNumber, array, size); * ---------------------------------------- * If 0 <= sortNumber < NumOfSorts(), then sorts the array which has size * integer elements. Else it returns without doing anything. */ void Sort(int sort, elementT array[], int size); /* * Function: SearchSortedArray * Usage: location = SearchSortedArray(array, size, key); * ---------------------------------------- * This is a O(log n) search. array must be sorted prior to calling. * The return value is the index of some array element which matches key * or -1 if key is not in the array. */ int SearchSortedArray(elmentT array[], int size, elementT key);