面试题6:重建二叉树

题目:输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不包含

重复的数字。

根据前序和中序遍历结果重构二叉树,参见LeetCode-Construct Binary Tree from Preorder and Inorder Traversal

根据中序和后序遍历结果重构二叉树,参见LeetCode-Construct Binary Tree from Inorder and Postorder Traversal

posted @ 2015-06-30 17:08  Rosanne  阅读(162)  评论(0编辑  收藏  举报