@Test public void testBinarySearch() { IntArray s1 = IntArray.wrap(1,4,5); assertEquals(0, s1.binarySearch(1)); assertEquals(2, s1.binarySearch(5)); assertEquals(-4, s1.binarySearch(7)); assertEquals(-1, s1.binarySearch(-10)); }
public int binarySearch(int x) { return Arrays.binarySearch(a, 0, length, x); }
IntArray { public int binarySearch(int x) { return Arrays.binarySearch(a, 0, length, x); } }
IntArray { public int binarySearch(int x) { return Arrays.binarySearch(a, 0, length, x); } IntArray();  IntArray(int capacity); private  IntArray(int[] a1); }
IntArray { public int binarySearch(int x) { return Arrays.binarySearch(a, 0, length, x); } IntArray();  IntArray(int capacity); private  IntArray(int[] a1); static IntArray wrap(int... array); void add(int x); void add(int pos, int x); int get(int pos); IntStream stream(); boolean isEmpty(); int[] toArray(); int size(); void set(int pos, int x); int indexOf(int x); int[] array(); String toString(); int binarySearch(int x); void sort(List<?> list); @Override int hashCode(); @Override boolean equals(Object obj); }
IntArray { public int binarySearch(int x) { return Arrays.binarySearch(a, 0, length, x); } IntArray();  IntArray(int capacity); private  IntArray(int[] a1); static IntArray wrap(int... array); void add(int x); void add(int pos, int x); int get(int pos); IntStream stream(); boolean isEmpty(); int[] toArray(); int size(); void set(int pos, int x); int indexOf(int x); int[] array(); String toString(); int binarySearch(int x); void sort(List<?> list); @Override int hashCode(); @Override boolean equals(Object obj); static int DEFAULT_CAPACITY; public int count; }