- 博客(4)
- 收藏
- 关注
原创 Leetcode:Construct Binary Tree from Inorder and Postorder Traversal
题目Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. 思路后序遍历中,最后一个节点是根节点,在中序遍历中根节点的左边是左子树,右边是右子树。实现上采用递归的方式。代码/**
2017-06-09 16:50:28 171
原创 Leetcode:Kill Process
题目Given n processes, each process has a unique PID (process id) and its PPID (parent process id).Each process only has one parent process, but may have one or more children processes. This is just like
2017-06-07 22:47:13 305
原创 LeetCode | Unique Binary Search Trees II
题目Given an integer n, generate all structurally unique BST’s (binary search trees) that store values 1…n.For example, Given n = 3, your program should return all 5 unique BST’s shown below. 1
2017-06-07 16:16:43 187
原创 LeetCode题解:Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next right node. If there is
2017-05-26 10:41:55 191
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人