文件名称:SPECULAR-REFLECTION-OF-A-TREE.cpp
-
所属分类:
- 标签属性:
- 上传时间:2014-12-16
-
文件大小:2.45kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
一棵树的镜面映射指的是对于树中的每个结点,都将其子结点反序。例如,对左边的树,镜面映射后变成右边这棵树。
a a
/ | \ / | b c f ===> f c b
/ \ / d e e d
我们在输入输出一棵树的时候,常常会把树转换成对应的二叉树,而且对该二叉树中只有单个子结点的分支结点补充一个虚子结点“$”,形成“伪满二叉树”。 例如,对下图左边的树,得到下图右边的伪满二叉树
a a
/ | \ / b c f ===> b $
/ \ / d e $ c
/ d f
/ $ e
然后对这棵二叉树进行前序遍历,如果是内部结点则标记为0,如果是叶结点则标记为1,而且虚结点也输出。
现在我们将一棵树以“伪满二叉树”的形式输入,要求输出这棵树的镜面映射的宽度优先遍历序列。 -A tree mirror mapping refers to each node in the tree, all its child nodes in reverse order. For example, after the tree on the left, to the right of the mirror is mapped into a tree. aa/| \/| \ bcf ===> fcb/\/\ deed us the input and output of a tree when the tree will often be converted into the corresponding binary tree, and a branch of the binary tree, only a single child node add a virtual child node node " $" , the formation of " Manchukuo binary tree." For example, the following figure on the left of the tree to get to the right of the figure below Manchukuo binary aa/| \/\ bcf ===> b $/\/\ de $ c/\ df/\ $ e and then the tree binary tree former preorder, if it is an internal node is labeled 0, if it is a leaf node labeled 1, and virtual nodes are output. Now we will one tree to the " Manchukuo binary" form input, output requirements specular mapping tree breadth-first traversal sequence.
a a
/ | \ / | b c f ===> f c b
/ \ / d e e d
我们在输入输出一棵树的时候,常常会把树转换成对应的二叉树,而且对该二叉树中只有单个子结点的分支结点补充一个虚子结点“$”,形成“伪满二叉树”。 例如,对下图左边的树,得到下图右边的伪满二叉树
a a
/ | \ / b c f ===> b $
/ \ / d e $ c
/ d f
/ $ e
然后对这棵二叉树进行前序遍历,如果是内部结点则标记为0,如果是叶结点则标记为1,而且虚结点也输出。
现在我们将一棵树以“伪满二叉树”的形式输入,要求输出这棵树的镜面映射的宽度优先遍历序列。 -A tree mirror mapping refers to each node in the tree, all its child nodes in reverse order. For example, after the tree on the left, to the right of the mirror is mapped into a tree. aa/| \/| \ bcf ===> fcb/\/\ deed us the input and output of a tree when the tree will often be converted into the corresponding binary tree, and a branch of the binary tree, only a single child node add a virtual child node node " $" , the formation of " Manchukuo binary tree." For example, the following figure on the left of the tree to get to the right of the figure below Manchukuo binary aa/| \/\ bcf ===> b $/\/\ de $ c/\ df/\ $ e and then the tree binary tree former preorder, if it is an internal node is labeled 0, if it is a leaf node labeled 1, and virtual nodes are output. Now we will one tree to the " Manchukuo binary" form input, output requirements specular mapping tree breadth-first traversal sequence.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
SPECULAR REFLECTION OF A TREE.cpp
__MACOSX/
__MACOSX/._SPECULAR REFLECTION OF A TREE.cpp
__MACOSX/
__MACOSX/._SPECULAR REFLECTION OF A TREE.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.