2014年4月3日

摘要: Problem Link:http://oj.leetcode.com/problems/binary-tree-postorder-traversal/The post-order-traversal of a binary tree is a classic problem, the recursive way to solve it is really straightforward, the pseudo-code is as follows. RECURSIVE-POST-ORDER-TRAVERSAL(TreeNode node) if node is NULL retur... 阅读全文

posted @ 2014-04-03 23:36 卢泽尔 阅读(443) 评论(0) 推荐(0)

摘要: Problem Link:http://oj.leetcode.com/problems/lru-cache/Long long ago, I had a post for implementing the LRU Cache in C++ in my homepage:http://www.cs.uml.edu/~jlu1/doc/codes/lruCache.htmlSo this time, I am trying to use Python to implement a LRU Cache.However, the result is Time Limit Exceeded.....M 阅读全文

posted @ 2014-04-03 22:56 卢泽尔 阅读(263) 评论(0) 推荐(0)

摘要: Problem Link:http://oj.leetcode.com/problems/interleaving-string/Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbbaccc", return false.T 阅读全文

posted @ 2014-04-03 05:01 卢泽尔 阅读(384) 评论(0) 推荐(0)