摘要: Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed? Would this affect the run-time complexity? How and why? Suppose an arra 阅读全文
posted @ 2017-02-01 09:09 CodesKiller 阅读(144) 评论(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). You a 阅读全文
posted @ 2017-02-01 08:14 CodesKiller 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed? Would this affect the run-time complexity? How and why? Suppose a 阅读全文
posted @ 2017-02-01 05:44 CodesKiller 阅读(121) 评论(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). Find 阅读全文
posted @ 2017-02-01 03:26 CodesKiller 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and 阅读全文
posted @ 2017-02-01 03:02 CodesKiller 阅读(235) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j]and the a 阅读全文
posted @ 2017-01-31 13:17 CodesKiller 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr 阅读全文
posted @ 2017-01-31 12:54 CodesKiller 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2017-01-31 12:46 CodesKiller 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2017-01-31 08:36 CodesKiller 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2017-01-31 07:23 CodesKiller 阅读(134) 评论(0) 推荐(0) 编辑