文件名称:tree
介绍说明--下载内容均来自于网络,请自行研究使用
假设以如下说明的三元组 (F、C、L/R) 序列输入一棵二叉树的诸边(其中 F 表示双亲结点的标识,C 表示孩子结点标识,L/R 表示 C 为 F 的左孩子或右孩子),且在输入的三元组序列中,C 是按层次顺序出现的。设结点的标识是字符类型。F=‘^’时 C 为根结点标识,若 C 亦为‘^’,则表示输入结束。试编写算法,由输入的三元组序列建立二叉树的二叉链表,并以中序序列输出。
^AL ABL ACR BDL CEL
CFR DGR FHL ^^L
-Assuming the following descr iption of the triple (F, C, L/R) sequence of a binary tree of all the input side (where F that identifies the parent node, C, said child node ID, L/R that C is F, left or right child child), and triples in the input sequence, C is the emergence of a hierarchical order. Node identity is established character types. F = ' ^' C for the root identity when, if C is also a ' ^' , then enter the end. Test preparation algorithm, the input sequence of triples binary build the binary tree list, and in order to sequence the output. ^ AL ABL ACR BDL CEL CFR DGR FHL ^ ^ L
^AL ABL ACR BDL CEL
CFR DGR FHL ^^L
-Assuming the following descr iption of the triple (F, C, L/R) sequence of a binary tree of all the input side (where F that identifies the parent node, C, said child node ID, L/R that C is F, left or right child child), and triples in the input sequence, C is the emergence of a hierarchical order. Node identity is established character types. F = ' ^' C for the root identity when, if C is also a ' ^' , then enter the end. Test preparation algorithm, the input sequence of triples binary build the binary tree list, and in order to sequence the output. ^ AL ABL ACR BDL CEL CFR DGR FHL ^ ^ L
(系统自动生成,下载前可以参看下载内容)
下载文件列表
tree.cpp