摘要: We use DFS to traverse the tree. For each node through the path, let sum = sum - node.val. When we look through a node, create a List<List<Integer>> t 阅读全文
posted @ 2016-01-29 14:21 爱推理的骑士 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Using the same DAC idea of previous problem. Difference is that we need to do the pointed operation of linked list rather than just change the index o 阅读全文
posted @ 2016-01-29 11:06 爱推理的骑士 阅读(157) 评论(0) 推荐(0) 编辑
摘要: We can use DAC to build a height balanced BST, in a block of array from low to high, if low == high we are finding one node, just add it. if low == hi 阅读全文
posted @ 2016-01-29 10:24 爱推理的骑士 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Same idea of the former problem, only difference is that the root is located in the last position of postorder array. And the left child is in pos-(en 阅读全文
posted @ 2016-01-29 09:41 爱推理的骑士 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Using DFS to traverse the node and build the a tree. for a node, it has following properties: If its a left child node of its parent, then the left bo 阅读全文
posted @ 2016-01-29 06:20 爱推理的骑士 阅读(131) 评论(0) 推荐(0) 编辑