#算法#二分搜索

template 
int LankeHelper::BinarySearch(Type a[], const Type& x, int n)
{
    int left = 0;
    int right = n-1;
    while(lefta[middle])
        {
            left = middle + 1;
        }
        else
        {
            right = middle - 1;
        }
    }
    return -1;
}

你可能感兴趣的:(#算法#二分搜索)