| java.lang.Object rcm.util.BinarySearch
BinarySearch | abstract public class BinarySearch (Code) | | Binary search routines.
|
Method Summary | |
public static int | search(int[] array, int offset, int length, int x) Search a sorted array of integers.
Parameters: array - Array of integers Parameters: offset - Starting offset of subarray to search Parameters: length - Length of subarray to search Parameters: x - Value to search for largest index i in subarray (offset <= i <= offset+length)such that all elements below i in the subarray are strictly lessthan x. |
search | public static int search(int[] array, int offset, int length, int x)(Code) | | Search a sorted array of integers.
Parameters: array - Array of integers Parameters: offset - Starting offset of subarray to search Parameters: length - Length of subarray to search Parameters: x - Value to search for largest index i in subarray (offset <= i <= offset+length)such that all elements below i in the subarray are strictly lessthan x. If x is found in the subarray, then array[i] == x (and i isthe first occurence of x in the subarray). If x is not found, then array[i] is where x should be inserted in the sort order. |
|
|