Given array vals[left,right] of strings, select random index within this range to use for partition. More...
#include <string.h>
Functions | |
int | selectPivotIndex (void **vals, int left, int right) |
Code to select a pivot index around which to partition ar[left, right]. |
Given array vals[left,right] of strings, select random index within this range to use for partition.
int selectPivotIndex | ( | void ** | vals, | |
int | left, | |||
int | right | |||
) |
Code to select a pivot index around which to partition ar[left, right].
Select median element of vals[left], vals[mid], and vals[right] to use.
vals | the array of elements. | |
left | the left end of the subarray range | |
right | the right end of the subarray range |
This really needs to have the comparison method passed in! But I don't want to change the interface, so this will suffice in the short term since all we have are strings in the example.
Algorithm Development Kit 1.0