posted @ 2014-05-13 10:09 卢泽尔 阅读(112) 评论(0) 推荐(0)
摘要:
Problem Link:http://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/OK... Exactly same to Populating Next Right Pointers in Ea... 阅读全文
摘要:
Problem Link:http://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/Just traverse the tree from the root, level by level. Esay en... 阅读全文
posted @ 2014-05-13 10:07 卢泽尔 阅读(204) 评论(0) 推荐(0)
摘要:
Problem Link:http://oj.leetcode.com/problems/pascals-triangle-ii/Let T[i][j] be the j-th element of the i-th row in the triangle, for 0 <= j <= i, i =... 阅读全文
posted @ 2014-05-13 09:19 卢泽尔 阅读(118) 评论(0) 推荐(0)
摘要:
Prolbem Link:http://oj.leetcode.com/problems/pascals-triangle/Just a nest-for-loop...class Solution: # @return a list of lists of integers def g... 阅读全文
posted @ 2014-05-13 08:52 卢泽尔 阅读(142) 评论(0) 推荐(0)
摘要:
Problem Link:http://oj.leetcode.com/problems/triangle/Let R[][] be a 2D array where R[i][j] (j <= i) is the minimum sum of the path from triangle[0][0... 阅读全文
posted @ 2014-05-07 04:29 卢泽尔 阅读(160) 评论(0) 推荐(0)
摘要:
Problem Link:http://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/Linear Time SolutionWe try to solve this problem in O(n) time in the ... 阅读全文
posted @ 2014-05-07 01:21 卢泽尔 阅读(155) 评论(0) 推荐(0)
摘要:
Problem Link:http://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/We solve this problem using Greedy Algorithm, which only scan the pric... 阅读全文
posted @ 2014-05-06 22:58 卢泽尔 阅读(215) 评论(0) 推荐(0)
摘要:
Problem Link:http://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/We solve this problem using DP algorithm, which only scans the prices lis... 阅读全文
posted @ 2014-05-06 22:46 卢泽尔 阅读(274) 评论(0) 推荐(0)
摘要:
Problem Link:http://oj.leetcode.com/problems/binary-tree-maximum-path-sum/For any path P in a binary tree, there must exists a node N in P such that N... 阅读全文
posted @ 2014-05-06 04:13 卢泽尔 阅读(336) 评论(0) 推荐(0)
摘要:
Problem Link:http://oj.leetcode.com/problems/word-ladder-ii/Basically, this problem is same to Word Ladder I, which uses a double-direction BFS. Howev... 阅读全文
posted @ 2014-05-06 01:58 卢泽尔 阅读(520) 评论(0) 推荐(0)
浙公网安备 33010602011771号