实验六 树的延伸
一、 实验目的
1、熟悉二叉线索树的基本操作。
2、深入了解递归在二叉树中的应用
二、 定义数据结构
线索二叉树
typedef struct BiThrNode{
TElemType data;
struct BiThrNode *lChild,*rChild;
unsigned char ltag,rtag;
}BiThrNode,*BiThrTree;
三、 实验内容
1、建立中序线索二叉树,并实现对二叉树的中序遍历,并将结
果输出。
void InThreading(BiThrTree T)
BiThrTree GetNext(BiThrTree P)
void InOrder(BiThrTree T)
测试数据(先序序列) 6 4 2 3 # # # # 5 1 # # 7 # #(#代表空结点)
2、仍沿用上面的数据,判断一个节点是否在一颗子树中(运用
二叉树的定义即可)
评论0