摘要:
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t... 阅读全文
摘要:
Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree. 1 /** 2 * De... 阅读全文
摘要:
Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree. 1 /** 2 * Def... 阅读全文
摘要:
Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al... 阅读全文
摘要:
首先定义二叉树的存储结构: 1 struct TreeNode {2 int val;3 TreeNode *left;4 TreeNode *right;5 6 TreeNode(int v, TreeNode* l = NULL, TreeNode *r = N... 阅读全文