查找算法——二分查找

under 数据结构与算法分析  tag     Published on April 30th , 2020 at 04:43 am

void fnBinarySearch(int t[], int left, int right)
{
    if (left <= right)
    {
        int mid = (left + right) >> 1;
        cout << t[mid] << ' ';
        fnBinarySearch(g_aList, left, mid - 1);
        fnBinarySearch(g_aList, mid + 1, right);
    }
}

本文由simyng创作, 采用知识共享署名4.0 国际许可协议进行许可,转载前请务必署名
  文章最后更新时间为:April 29th , 2020 at 08:43 pm