List of utility methods to do Binary Search
int | binarySearchReversed(int[] a, int fromIndex, int toIndex, int key) binary Search Reversed int low = fromIndex; int high = toIndex - 1; while (low <= high) { int mid = (low + high) >>> 1; int midVal = a[mid]; if (midVal > key) low = mid + 1; else if (midVal < key) ... |
int | binarySearchStringArray(String[] array, String item, int first, int last) binary Search String Array if (last < first) { return -1; int mid = (first + last) / 2; if (array[mid].equals(item)) { return mid; if (item.compareTo(array[mid]) < 0) { ... |