设为首页 加入收藏

TOP

[LeetCode]162.Find Peak Element(二)
2015-07-20 17:21:43 来源: 作者: 【 】 浏览:6
Tags:LeetCode 162.Find Peak Element
ins a peak if(num[mid] < num[mid - 1]){ return helper(num,left,mid - 1); }//if // If num[i-1] < num[i],then num[i+1...n-1] must contains a peak else{ return helper(num,mid + 1,right); }//else } }; int main(){ Solution solution; //vector num = {1,2,3,1}; //vector num = {4,3,3,1}; vector num = {2,3,1,4,2,1}; int result = solution.findPeakElement(num); // 输出 cout< \

?

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇HDOJ 1663 The Counting Problem .. 下一篇NYOJ 323 && HDU 1532 &a..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C 内存管理 | 菜鸟教 (2025-12-26 20:20:37)
·如何在 C 语言函数中 (2025-12-26 20:20:34)
·国际音标 [ç] (2025-12-26 20:20:31)
·微服务 Spring Boot (2025-12-26 18:20:10)
·如何调整 Redis 内存 (2025-12-26 18:20:07)