typedef struct BiThrNod { TElemType data; struct BiThrNode *lchild, *rchild; // 左右指针 PointerThr LTag, RTag; // 左右标志 } BiThrNode, *BiThrTree; 线索链表的类型描述: typedef enum { Link, Thread } PointerThr; // Link==0:指针,Thread==1:线索 实现 在有n个结点的二叉链表中必定有n+1个空链域 在线索二叉树的结点中增加两个标志域 ltag :若 ltag=0, lchild 域指向左孩子; 若 ltar=1, lchild域指向其前驱 rtag :若 rtag =0, rchild 域指向右孩子; 若 rtag=1, rchild域指向其后继 typedef struct node { int data; int ltag, rtag; struct node *lchild, *rchild; }JD; A B C D E A B D C E T 先序序列:ABCDE 先序线索二叉树 0 0
原创力文档

文档评论(0)