2015年1月22日

摘要: 题目:A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and return its ind... 阅读全文
posted @ 2015-01-22 23:10 承续缘 阅读(876) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the ... 阅读全文
posted @ 2015-01-22 14:41 承续缘 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 题目:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,2... 阅读全文
posted @ 2015-01-22 00:12 承续缘 阅读(1333) 评论(1) 推荐(1) 编辑

导航