Binary Search
Peng_maple
这个作者很懒,什么都没留下…
展开
-
[LeetCode] 34. Find First and Last Position of Element in Sorted Array Medium
Find First and Last Position of Element in Sorted ArrayGiven an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s runti...原创 2019-03-29 13:02:36 · 215 阅读 · 0 评论 -
[LeetCode] 33. Search in Rotated Sorted Array
Search in Rotated Sorted ArraySuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).You are given a targ...原创 2019-03-29 10:00:58 · 146 阅读 · 0 评论 -
[LeetCode] 4. Median of Two Sorted Arrays
Median of Two Sorted ArraysThere are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n))....原创 2019-03-24 19:51:44 · 162 阅读 · 0 评论