Algorithm
Development Kit 1.0

algs.model.array
Interface IPivotIndex

All Known Implementing Classes:
FirstSelector, LastSelector, MedianSelector, PISelector, RandomSelector

public interface IPivotIndex

Interface describing behavior for selecting a pivotIndex for partition.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Method Summary
 int selectPivotIndex(java.lang.Comparable[] ar, int left, int right)
          Select a pivot from the given subarray ar[left,right].
 

Method Detail

selectPivotIndex

int selectPivotIndex(java.lang.Comparable[] ar,
                     int left,
                     int right)
Select a pivot from the given subarray ar[left,right].

Parameters:
ar - base array of elements.
left - left index of sub-array
right - right index of sub-array
Returns:
an integer index value in the range [left,right] around which to pivot.

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.