11 int length() const { return( len ); }
13 List() : len( 0 ), array( 0 ) {}
17 int AlgoStdCompare(const T* a, const T* b) {
21 return (*a > *b); // 0 if equal, 1 if greater
24 int AlgoStdCompare(const char* const* a, const char * const*b)
30 void AlgoFixupSort(List< T >* , int, int ) {
34 void AlgoSort(int (*compare)(const T *, const T *),
35 void (*fixup)( List<T> *, int first, int last),
36 List< T >* theList, int first, int last) {
38 last = theList->length()-1;
40 qsort(theList->array+first, last-first+1, sizeof(T),
41 (int (*)(const void *, const void *))compare);
43 fixup(theList, first, last);
47 void AlgoSort(List< T >* theList, int first = 0, int last = -1) {
48 int (*compare)(const T*, const T*) = AlgoStdCompare;
49 void (*fixup)( List<T> *, int first, int last) = AlgoFixupSort;
51 AlgoSort(compare, fixup, theList, first, last);
57 List<const char *> slist;