#ifndef __SORT_H__ #define __SORT_H__ /** * Procedure: * sort * Parameters: * arr, an array of pointers. * left, an integer. * right, an integer * comp, a comparator * Purpose: * Sort arr[left..right] into increasing order. * Produces: * [Nothing; Called for the side effect] * Preconditions: * 0 <= left <= right < length of arr. * comp can be applied to all elements of the arrays. * Postconditions: * Elements have neither been added nor removed, just rearranged. * comp(arr[i],arr[i+1]) <= 0 for left <= i < right. */ void sort(void *arr[], int left, int right, int (*comp)(const void *, const void *)); #endif // __SORT_H__