1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
template < class T >
class RadixSort
{
private:
static char getRadixChar(T* item, int index); //1-based
static void binSort(QueueLinked<T>* bin, int curr_char, int num_chars, char (*getRadixChar) (T* item, int index));
static void radixSortAsc(T** sort, int n, int num_chars, char (*getRadixChar) (T* item, int index)); //algorithm 1
static void radixSortDesc(T** sort, int n, int num_chars, char (*getRadixChar) (T* item, int index)); //algorithm 2
public:
static T** radixSort(T** sort, int num_to_sort, int num_chars, bool asc, char (*getRadixChar) (T* item, int index));
};
template < class T >
char RadixSort<T>::getRadixChar(T* item, int index)
{
//return 0;
//Test stub
}
| |