设为首页 加入收藏

TOP

[LeetCode]162.Find Peak Element(二)
2015-07-20 17:21:43 来源: 作者: 【 】 浏览:9
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..

评论

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

·Redis on AWS:Elast (2025-12-27 04:19:30)
·在 Spring Boot 项目 (2025-12-27 04:19:27)
·使用华为开发者空间 (2025-12-27 04:19:24)
·Getting Started wit (2025-12-27 03:49:24)
·Ubuntu 上最好用的中 (2025-12-27 03:49:20)