49 #ifdef NO_STD_CHEADERS 78 ArrayPtr = UserArrayPtr;
79 CompareFunct = _CompareFunct;
81 QuickSortCreated =
true;
88 QuickSortCreated =
false;
99 ArrayPtr[a] = ArrayPtr[b];
108 if (QuickSortCreated)
111 void* x = ArrayPtr[min];
114 bool ExitFlag =
false;
119 while ((CompareFunct (ArrayPtr[k], x) > 0) && (k>min));
122 while ((CompareFunct (ArrayPtr[j], x) < 0) && (j<max));
135 if (QuickSortCreated)
137 if (minEntryIndex < maxEntryIndex)
139 int index = rand () % (maxEntryIndex-minEntryIndex+1) + minEntryIndex;
140 int mid = Partition (minEntryIndex, maxEntryIndex, index);
141 Sort (minEntryIndex, mid);
142 Sort (mid+1, maxEntryIndex);
int(* EntryCompareFunctPtr)(const void *, const void *)
void Sort(const int minEntryIndex, const int maxEntryIndex)
int Partition(const int min, const int max, const int q)
void Create(void **UserArrayPtr, const EntryCompareFunctPtr _CompareFunct)