欢迎来到PJCK的博客

随笔分类 -  数据结构与算法----查找----二分查找

binary_search lower_bound
摘要:Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2019-04-28 18:26 PJCK 阅读(137) 评论(0) 推荐(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 阅读全文
posted @ 2019-04-23 21:14 PJCK 阅读(117) 评论(0) 推荐(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]). Y 阅读全文
posted @ 2019-04-23 20:07 PJCK 阅读(379) 评论(0) 推荐(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 阅读全文
posted @ 2019-04-23 19:44 PJCK 阅读(176) 评论(0) 推荐(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 阅读全文
posted @ 2019-04-23 19:01 PJCK 阅读(155) 评论(0) 推荐(0)
摘要:Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime com 阅读全文
posted @ 2019-04-23 18:06 PJCK 阅读(100) 评论(0) 推荐(0)
摘要:find the nth digit Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 14416 Accepted Submission(s): 阅读全文
posted @ 2018-06-12 16:22 PJCK 阅读(166) 评论(0) 推荐(0)
摘要:Can you find it? Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/10000 K (Java/Others) Total Submission(s): 35782 Accepted Submission(s): 阅读全文
posted @ 2018-06-12 16:21 PJCK 阅读(131) 评论(0) 推荐(0)