摘要:
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 @ 2016-09-21 13:41
Machelsky
阅读(119)
评论(0)
推荐(0)
摘要:
Design and implement a TwoSum class. It should support the following operations: add and find. add - Add the number to an internal data structure.find 阅读全文
posted @ 2016-09-21 13:13
Machelsky
阅读(150)
评论(0)
推荐(0)
摘要:
This is a follow up of Shortest Word Distance. The only difference is now word1 could be the same as word2. Given a list of words and two words word1 阅读全文
posted @ 2016-09-21 12:37
Machelsky
阅读(155)
评论(0)
推荐(0)
摘要:
This is a follow up of Shortest Word Distance. The only difference is now you are given the list of words and your method will be called repeatedly ma 阅读全文
posted @ 2016-09-21 12:07
Machelsky
阅读(141)
评论(0)
推荐(0)
摘要:
Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. For example, Assume that words 阅读全文
posted @ 2016-09-21 11:40
Machelsky
阅读(123)
评论(0)
推荐(0)
摘要:
Implement pow(x, n). 看不动书了,简直已经读不进去!!还剩dp和部分hashtable median没看,有兴致再看吧。马丹书上都没有binomial heap为毛老师会讲这种很难实现的数据结构!! Solution1: 思路:递归。要注意把一半的pow存在一个变量再输出,不然复 阅读全文
posted @ 2016-09-21 11:17
Machelsky
阅读(128)
评论(0)
推荐(0)