两个算法的实现:
///////////////////////////////////////////////////////
//BinarySearch()公有成员函数
//对有序顺序表进行折半搜索(非递归)
///////////////////////////////////////////////////////
template<class K>
int SortedList<K>::BinarySearch(const K x)const
{
    int low=0;
                          //查找下限 
    int
    high=CurrentSize-1;
             //查找上限
    int mid;
                            //查找中间点
    while(low<=high)
                    //查找过程
    {
        mid=(low+high)/2;
               //求中点
        if(x<Element[mid].getKey())
     //如果x小于中点的值
            high=mid-1;
             
        else if(x>Element[mid].getKey())//如果x大于中点的值
            low=mid+1;
        else
            return mid;
    };
    return -1;
                          //如果没有找到
};
/////////////////////////////////BinarySearch()函数结束
///////////////////////////////////////////////////////
//BinarySearchRe()公有成员函数
//折半查找的递归算法
///////////////////////////////////////////////////////
template<class K>
int SortedList<K>::BinarySearchRe(K x,int low,int high)const
{
    if(low<=high)
    {
        int mid=(low+high)/2;
                   //得到中点
         if(x<Element[mid].getKey())
             //如果x小于中点的值
            return BinarySearchRe(x,low,mid-1); //在前半部分找
        else if(x>Element[mid].getKey())
        //如果x大于中点的值
            return BinarySearchRe(x,mid+1,high);//在后半部分找
        else
            return mid;
                         //如果找到
    }
    else
        return -1;
};
////////////////////////////////BinarySeachRe()函数结束
建议你再看一下飞播那切查找