Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## applications
Class BinarySearch

    java.lang.Object
      |
      +--applications.BinarySearch

public class BinarySearch
extends java.lang.Object

Constructor Summary
`BinarySearch()`

Method Summary
`static int` | `binarySearch(java.lang.Comparable[] a, java.lang.Comparable x)` Search the ordered array a for x.
`static void` | `main(java.lang.String[] args)` test program

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### BinarySearch

    public BinarySearch()

Method Detail

### binarySearch

    public static int binarySearch(java.lang.Comparable[] a,
                                   java.lang.Comparable x)

  Search the ordered array a for x. CAUTION: Object.equals must be overriden for this method to work correctly
  Returns:
    position of x if found; -1 otherwise

### main

    public static void main(java.lang.String[] args)

  test program

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD