Name

qksort

Synopsis

int qksort(void *data, int size, int esize, int i, int k, int (*compare) 
   (const void *key1, const void *key2));

Return Value

0 if sorting is successful, or -1 otherwise.

Description

Uses quicksort to sort the array of elements in data. The number of elements in data is specified by size. The size of each element is specified by esize. The arguments i and k define the current partition being sorted and initially should be and size - 1, respectively. The function pointer compare specifies a user-defined function to compare elements. It should perform in a manner similar to that described for issort. When qksort returns, data contains the sorted elements.

Complexity

O (n lg n), where n is the number of elements to be sorted.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.223.123