Sorting/PointerBased/pivotFirst.c File Reference

Code to select leftmost element as pivot index

Given array vals[left,right] select left as the pivot index. More...


Functions

int selectPivotIndex (void **vals, int left, int right)
 Code to select a pivot index around which to partition ar[left, right].


Detailed Description

Code to select leftmost element as pivot index

Given array vals[left,right] select left as the pivot index.

Author:
George Heineman
Date:
6/15/08

Function Documentation

int selectPivotIndex ( void **  vals,
int  left,
int  right 
)

Code to select a pivot index around which to partition ar[left, right].

Select the leftmost one.

Parameters:
vals the array of elements.
left the left end of the subarray range
right the right end of the subarray range
Returns:
int in the range [left, right] to use in partition.

Algorithm Development Kit 1.0