public class Demo
{
public static void main(String[] args)
{
int[] arr = {1,3,5,7,9,10,15,18};
int m = 11;
//getMax(arr);
//bubble(arr);
half(arr,m);
}
public static void half(int[] arr,int m)
{
int x =0;
int y = (x+arr.length)/2;
while(m != arr[y])
{
if(m>arr[y])
{
x=y;
y=(x+arr.length)/2;
}
if(m
{
y = (x+y)/2;