上一页 1 2 3 4 5 6 ··· 10 下一页
摘要: 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) 编辑
摘要: As we know, if we traverse in from left to right level order, we can use a Queue to store all the nodes in this level from left to right. While in zig 阅读全文
posted @ 2016-01-28 13:34 爱推理的骑士 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Using DFS to traverse the BST, when we look through the BST to a certain node, this node must have the following property to make sure the tree is a v 阅读全文
posted @ 2016-01-28 12:21 爱推理的骑士 阅读(125) 评论(0) 推荐(0) 编辑
摘要: This is only a DP problem to count the number of all the possible combination(here is the unique binary tree). We can easily find that when n = 0 or 1... 阅读全文
posted @ 2016-01-27 12:57 爱推理的骑士 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Use DP to generate unique distinct binary trees;Create to two integer value, one "start" to represent the lowest value, and the other "end" to represe... 阅读全文
posted @ 2016-01-27 10:06 爱推理的骑士 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Inoder traversal means that traverse the left subtree of current node first, than display current node's value, afterwards traverse the right subtree ... 阅读全文
posted @ 2016-01-27 04:33 爱推理的骑士 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Code:public class Solution { public List restoreIpAddresses(String s) { List list = new ArrayList(); int len = s.length(); if(... 阅读全文
posted @ 2016-01-25 07:53 爱推理的骑士 阅读(131) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 10 下一页