上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页
摘要: 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)
摘要: 好难啃,大篇幅的证明和theorem醉醉的。CH1,2,3,4,5,6,7,10,16,22,23,24。希望明后天能啃完数据结构和动态规划。。。 阅读全文
posted @ 2016-09-20 11:50 Machelsky 阅读(141) 评论(0) 推荐(0)
摘要: 记啃clrs的第三天。此书自带催眠功能。 Recursion is a "Programming Paradigm" which is generally used to implement the "Algorithmic Paradigm" Divide and Conquer . Ref:ht 阅读全文
posted @ 2016-09-19 12:15 Machelsky 阅读(142) 评论(0) 推荐(0)
摘要: Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For 阅读全文
posted @ 2016-09-17 11:26 Machelsky 阅读(278) 评论(0) 推荐(0)
摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2016-09-17 10:47 Machelsky 阅读(163) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页