代码改变世界

[LeetCode] 153. Find Minimum in Rotated Sorted Array_Medium tag: Binary Search

2018-08-31 06:53 by Johnson_强生仔仔, 260 阅读, 0 推荐, 收藏, 编辑
摘要:Suppose 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]). F 阅读全文

[LeetCode] 69. Sqrt(x)_Easy tag: Binary Search

2018-08-31 06:35 by Johnson_强生仔仔, 195 阅读, 0 推荐, 收藏, 编辑
摘要:Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return type is an in 阅读全文

[LeetCode] 240. Search a 2D Matrix II_Medium tag: Binary Search

2018-08-31 06:21 by Johnson_强生仔仔, 279 阅读, 0 推荐, 收藏, 编辑
摘要:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted i 阅读全文

[LeetCode] 74. Search a 2D Matrix_Medium tag: Binary Search

2018-08-30 11:08 by Johnson_强生仔仔, 232 阅读, 0 推荐, 收藏, 编辑
摘要:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文

[LeetCode] 162. Find Peak Element(852. Peak Index in a Mountain Array)_Medium tag: Binary Search

2018-08-29 11:39 by Johnson_强生仔仔, 183 阅读, 0 推荐, 收藏, 编辑
摘要:A peak element is an element that is greater than its neighbors. Given an input array nums, where nums[i] ≠ nums[i+1], find a peak element and return 阅读全文

[LeetCode] 278. First Bad Version_Easy tag: Binary Search

2018-08-29 11:19 by Johnson_强生仔仔, 145 阅读, 0 推荐, 收藏, 编辑
摘要:You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文

[LeetCode] 35. Search Insert Position_Easy tag: Binary Search

2018-08-29 10:34 by Johnson_强生仔仔, 210 阅读, 0 推荐, 收藏, 编辑
摘要:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or 阅读全文

[LeetCode] 34. Find First and Last Position of Element in Sorted Array == [LintCode] 61. Search for a Range_Easy tag: Binary Search

2018-08-29 10:06 by Johnson_强生仔仔, 266 阅读, 0 推荐, 收藏, 编辑
摘要:Description Given a sorted array of n integers, find the starting and ending position of a given target value. If the target is not found in the array 阅读全文

[LeetCode] 374. Guess Number Higher or Lower_Easy tag: Binary Search

2018-08-29 07:22 by Johnson_强生仔仔, 209 阅读, 0 推荐, 收藏, 编辑
摘要:We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron 阅读全文

[LeetCode] 704. Binary Search_Easy tag: Binary Search

2018-08-29 06:52 by Johnson_强生仔仔, 219 阅读, 0 推荐, 收藏, 编辑
摘要:Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If target exists, 阅读全文
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 39 下一页