Binary Search Algorithm: 
Search a sorted array by repeatedly dividing the search interval in half. Begin with an interval covering the whole array. If the value of the search key is less than the item in the middle of the interval, narrow the interval to the lower half. Otherwise, narrow it to the upper half. Repeatedly check until the value is found or the interval is empty.


public class Binary_Search {

    public static void main(String[] a) {
        Scanner sc = new Scanner(System.in);
        int arra[] = new int[200], n, value, high, low = 0, mid;
        System.out.println("Must enter 6 orderde value");
        for (int i = 0; i < 6; i++) {
            arra[i] = sc.nextInt();
        }
        System.out.println("Enter the Search value");
        value = sc.nextInt();
        high = 6;
        while (low <= high) {
            mid = (high + low) / 2;
            if (arra[mid] == value) { 
                System.out.println(value + " Value is exist");
                return;
            } else if (arra[mid] > value) {
                high = mid - 1;
            } else {
                low = mid + 1;
            }

        }
        System.out.println(value + " Vlaue is not exist");

    }
}