《[计算机软件及应用]中序遍历线索二叉树的演示》由会员分享,可在线阅读,更多相关《[计算机软件及应用]中序遍历线索二叉树的演示(53页珍藏版)》请在金锄头文库上搜索。
1、Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p data) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,Status InorderTraverse_Thr(BiThrTreeT,
2、Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p data) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tlchild; w
3、hile(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p data) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag = =Link) p=p l
4、child; if(!visit(p data) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p data) return error;
5、 while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p data) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0
6、,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,a,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p data) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0
7、,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,a,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p data) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,
8、a,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p data) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,a+,Status InorderTraverse_Thr(BiThrT
9、reeT,Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p data) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,a+,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tl
10、child; while(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p data) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,p,a+,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag =
11、 =Link) p=p lchild; if(!visit(p data) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,p,a+,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p d
12、ata) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,p,a+,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p data) return error; while(p RTag =
13、 =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,p,a+,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)(TElemType) p=Tlchild; while(p!=T) while(p LTag = =Link) p=p lchild; if(!visit(p data) return error; while(p RTag = =Thread ,0,0,+,0,0,-,0,0,/,0,0,*,1,1,e,1,1,f,1,1,a,1,1,b,0,0,-,1,1,c,1,1,d,0,1,thrt,中序遍历线索二叉树,p,a+b,Status InorderTraverse_Thr(BiThrTreeT,Status(*visit)