prg_vector_sort()
Abstract
Sorts the elements of a vector using a quicksort algorithm and a user-supplied comparison procedure.
Syntax
prg_vector_sort (vector_ptr, compare_proc)
| Argument | Type | Description |
|---|---|---|
vector_ptr |
PrgT_Vector * |
vector to be sorted |
compare_proc |
PrgT_Vector_Compare_Proc |
procedure used to compare elements during the sort |
Return Type
void
No return value.
Header
prg_vector.h
Details
This function sorts the elements of a vector using an implementation of the quicksort algorithm.
The vector sort can be orders of magnitude faster than a list sort done with prg_list_sort(). To take advantage of this speed, you can transfer a list to a vector (PrgT_Vector) and use prg_vector_sort(). The compare_proc can be the same one used for the list sort.
The prototype for compare_proc is given in PrgT_Vector_Compare_Proc.