摘要:
二分查找算法就是不断将数组进行对半分割,每次拿中间元素和goal进行比较。 #include <iostream>using namespace std;//二分查找int binary_search(int* a, int len, int goal);int main(){ const int 阅读全文
摘要:
A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its inde 阅读全文