上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页

2017年5月11日

摘要: Important Note:1) Pay attention to the number that is less than 1.0, because x^0.5 will larger than x. So we need to always set the right side to be 1 阅读全文
posted @ 2017-05-11 05:27 codingEskimo 阅读(120) 评论(0) 推荐(0)
摘要: Important Reference: http://stackoverflow.com/questions/13093602/finding-subarray-with-maximum-sum-number-of-elements http://www.jiuzhang.com/qa/2942/ 阅读全文
posted @ 2017-05-11 04:43 codingEskimo 阅读(115) 评论(0) 推荐(0)

2017年5月10日

摘要: The reference link: http://www.code123.cc/docs/leetcode-notes/binary_search/search_a_2d_matrix_ii.html 题解 - 自右上而左下 阅读全文
posted @ 2017-05-10 07:02 codingEskimo 阅读(95) 评论(0) 推荐(0)

2017年5月9日

摘要: This question is very hard, just remember it:Explaination: 思路清晰,就是二倍法。直接用除数去一个一个加,直到被除数被超过的话,会超时。解决办法每次将被除数增加1倍,同时将count也增加一倍,如果超过了被除数,那么用被除数减去当前和再继续本 阅读全文
posted @ 2017-05-09 10:11 codingEskimo 阅读(110) 评论(0) 推荐(0)
摘要: Important Node: 1) This problem has two parts: a. find the closest number's to the target and return its index. This is standard binary search problem 阅读全文
posted @ 2017-05-09 08:09 codingEskimo 阅读(107) 评论(0) 推荐(0)

2017年5月4日

摘要: The worst situation O(N). Actually we can either just loop through, or we can compare num[mid] with the num[end], if they are the same, that means it' 阅读全文
posted @ 2017-05-04 07:58 codingEskimo 阅读(92) 评论(0) 推荐(0)
摘要: O(logN) This question turns to find the first and last element of the target in a sorted array. Just be careful with the two result coming out of the 阅读全文
posted @ 2017-05-04 07:25 codingEskimo 阅读(94) 评论(0) 推荐(0)
摘要: O(N) if element can repeat, the worst case, you cannot throw away any section. eg. [1, 1, 1, 1, 0, 1, 1] target = 0, you cannot throw any section. We 阅读全文
posted @ 2017-05-04 07:11 codingEskimo 阅读(51) 评论(0) 推荐(0)
摘要: O(logN) Important Point: Once the target is in one section, use the point in that section as benchmark In this problem, if the target >= startVal, use 阅读全文
posted @ 2017-05-04 06:55 codingEskimo 阅读(106) 评论(0) 推荐(0)
摘要: O(logN) 阅读全文
posted @ 2017-05-04 06:21 codingEskimo 阅读(75) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页

导航