public static void main(String[] args) {
// TODO Auto-generated method stub
int arr[]={2,5,7,12,25};
BinaryFind bf=new BinaryFind();
bf.find(0, arr.length-1, 7, arr);
}
}
class BinaryFind
{
public void find(int leftIndex,int rightIndex,int val,int arr[])
{
//首先找到中间的数
int midIndex=(leftIndex+rightIndex)/2;
int midVal=arr[midIndex];