posted @ 2016-04-24 01:37 卢泽尔 阅读(132) 评论(0) 推荐(0)
摘要:
All blogs are moved to my currently-used site: http://jianlu.github.io/ 阅读全文
摘要:
The Singleton pattern is one of the simplest design patterns, which restricts the instantiation of a class to ONLY ONE object. A singleton class only ... 阅读全文
posted @ 2014-12-30 10:15 卢泽尔 阅读(224) 评论(0) 推荐(0)
摘要:
Problem Link:https://oj.leetcode.com/problems/validate-binary-search-tree/We inorder-traverse the tree, and for each node we check if current_node.val... 阅读全文
posted @ 2014-05-27 05:59 卢泽尔 阅读(251) 评论(0) 推荐(0)
摘要:
Problem Link:https://oj.leetcode.com/problems/recover-binary-search-tree/We know that the inorder traversal of a binary search tree should be a sorted... 阅读全文
posted @ 2014-05-27 05:52 卢泽尔 阅读(181) 评论(0) 推荐(0)
摘要:
Problem Link:https://oj.leetcode.com/problems/same-tree/The following recursive version is accepted but the iterative one is not accepted...# Definiti... 阅读全文
posted @ 2014-05-27 05:09 卢泽尔 阅读(195) 评论(0) 推荐(0)
摘要:
Problem Link:https://oj.leetcode.com/problems/symmetric-tree/To solve the problem, we can traverse the tree level by level. For each level, we constru... 阅读全文
posted @ 2014-05-27 04:56 卢泽尔 阅读(341) 评论(0) 推荐(0)
摘要:
Problem Link:https://oj.leetcode.com/problems/binary-tree-level-order-traversal/Traverse the tree level by level using BFS method.# Definition for a ... 阅读全文
posted @ 2014-05-27 04:38 卢泽尔 阅读(189) 评论(0) 推荐(0)
摘要:
Problem Link:https://oj.leetcode.com/problems/binary-tree-zigzag-level-order-traversal/Just BFS from the root and for each level insert a list of valu... 阅读全文
posted @ 2014-05-27 04:36 卢泽尔 阅读(170) 评论(0) 推荐(0)
摘要:
Problem Link:https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/Simply BFS from root and count the number of levels. The code is as follows... 阅读全文
posted @ 2014-05-27 04:30 卢泽尔 阅读(284) 评论(0) 推荐(0)
摘要:
Problem Link:https://oj.leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/The basic idea is same to that for Construct B... 阅读全文
posted @ 2014-05-27 04:26 卢泽尔 阅读(212) 评论(0) 推荐(0)
浙公网安备 33010602011771号