java复习之二分查找

java复习之二分查找

package learn;

public class BinarySearch {
    public static int binarySearch(int[] array,int left,int right,int num){
        if(left>right){
            return -1;
        }
        int mid=(left+right)/2;
        if(num>array[mid]){
            return binarySearch(array,mid+1,right,num);
        }else if(num

你可能感兴趣的:(数据结构,笔记,java复习)