Small Code Of Binary Search - Online Code


it is the sample code on binary search,first enter the size of array and then enter the elements according to that,then enter the item that u want to search ,output will be "Successful or Unsuccessful search".

Source Code

import java.util.*;

class BinarySearch
static int a[],size,mid;

public static void doSearch(int[] s,int lenght)
int low=0;

int up=lenght-1;

System.out.println("enter the item ,you wanna to search"
... (login or register to view full code)

To view full code, you must Login or Register, its FREE.

Hey, registering yourself just takes less than a minute and opens up a whole new GetGyan experience.


No comment yet. Be the first to post a comment.