摘要: "https://leetcode.com/problems/peak index in a mountain array/" 给定一个 mountain 数组(满足A.length = 3,There exists some 0 A[i+1] ... A[A.length 1]),求其最大值 此题 阅读全文
posted @ 2020-03-20 21:21 默写年华 阅读(104) 评论(0) 推荐(0) 编辑
摘要: "https://leetcode.com/problems/find peak element/" 给定一个无序数组,且nums[i] != nums[i+1],找出其中的peak元素,即比左右两边的元素都要大的元素,可以假设nums[ 1] 和nums[n]都是负无穷,如果存在多个peak,只需 阅读全文
posted @ 2020-03-20 19:18 默写年华 阅读(149) 评论(0) 推荐(0) 编辑
摘要: "https://leetcode.com/problems/find first and last position of element in sorted array/" 给定一个有序数组,可能包含有重复元素,问target在数组中的起始位置和结束位置,要求复杂度 $O(logN)$ \ Ex 阅读全文
posted @ 2020-03-20 11:53 默写年华 阅读(103) 评论(0) 推荐(0) 编辑
摘要: "https://leetcode.com/problems/search in rotated sorted array ii/" 对于一个有序数组,将其元素以某一个元素为轴进行旋转,比如[0,1,2,3,4,5,6,7]可能会变成[4,5,6,7,0,1,2,3] 求这个经过旋转的数组中是否存在 阅读全文
posted @ 2020-03-20 10:35 默写年华 阅读(129) 评论(0) 推荐(0) 编辑