Maximum Number in Mountain Sequence
Given a mountain sequence ofn
integers which increase firstly and then decrease, find the mountain top.
解析 :
这道题跟rotated sorted array不一样,不能用中间值和最后值比较来判断哪部分是有序。
我们只需要通过比较mid和mid+1的大小来判断mid是处于上坡还是下坡。
Last updated
Was this helpful?