文件名称:REBUILD-BINARY-TREE.cpp
介绍说明--下载内容均来自于网络,请自行研究使用
我们知道如何按照三种深度优先次序来周游一棵二叉树,来得到中根序列、前根序列和后根序列。反过来,如果给定二叉树的中根序列和后根序列,或者给定中根序列和前根序列,可以重建一二叉树。本题输入一棵二叉树的中根序列和后根序列,要求在内存中重建二叉树,最后输出这棵二叉树的前根序列。
用不同的整数来唯一标识二叉树的每一个结点,下面的二叉树
中根序列是9 5 32 67
后根序列9 32 67 5
前根序列5 9 67 32
-We know how to prioritize according to three kinds of depth to travel around a binary tree to get the root sequence, sequence and ventral root root sequence. Conversely, if a given sequence of binary tree root and root sequence, or a given sequence and anterior root root sequence, you can rebuild a binary tree. The title input binary tree root root sequence after sequence and require rebuilding binary tree in memory before the final output binary tree root sequence. Different integer that uniquely identifies each node of a binary tree, the following sequence is a binary tree roots before 932,675 953,267 root sequence after sequence 596 732 root
用不同的整数来唯一标识二叉树的每一个结点,下面的二叉树
中根序列是9 5 32 67
后根序列9 32 67 5
前根序列5 9 67 32
-We know how to prioritize according to three kinds of depth to travel around a binary tree to get the root sequence, sequence and ventral root root sequence. Conversely, if a given sequence of binary tree root and root sequence, or a given sequence and anterior root root sequence, you can rebuild a binary tree. The title input binary tree root root sequence after sequence and require rebuilding binary tree in memory before the final output binary tree root sequence. Different integer that uniquely identifies each node of a binary tree, the following sequence is a binary tree roots before 932,675 953,267 root sequence after sequence 596 732 root
(系统自动生成,下载前可以参看下载内容)
下载文件列表
REBUILD BINARY TREE.cpp
__MACOSX
........\._REBUILD BINARY TREE.cpp