10 int length() const { return( len ); }
12 List() : len( 0 ), array( 0 ) {}
16 int AlgoStdCompare(const T* a, const T* b) {
20 return (*a > *b); // 0 if equal, 1 if greater
23 int AlgoStdCompare(const char* const* a, const char * const*b)
29 void AlgoFixupSort(List< T >* , int, int ) {
33 void AlgoSort(int (*compare)(const T *, const T *),
34 void (*fixup)( List<T> *, int first, int last),
35 List< T >* theList, int first, int last) {
37 last = theList->length()-1;
39 qsort(theList->array+first, last-first+1, sizeof(T),
40 (int (*)(const void *, const void *))compare);
42 fixup(theList, first, last);
46 void AlgoSort(List< T >* theList, int first = 0, int last = -1) {
47 int (*compare)(const T*, const T*) = AlgoStdCompare;
48 void (*fixup)( List<T> *, int first, int last) = AlgoFixupSort;
50 AlgoSort(compare, fixup, theList, first, last);
56 List<const char *> slist;