//先序遍历递归 int PreOrderTraverse(BiTree T,int (* Visit)(char e)){ if(T){ if(Visit(T->data)){ if(PreOrderTraverse(T->lchild,Visit)) if(PreOrderTraverse(T->rchild,Visit)) return 1; } return 0; }else return 1; } //中序遍历递归 void MidOrderTraverse(BiTree T,int (*Visit)(char e)){ if(T){ MidOrderTraverse(T->lchild,Visit); Visit(T->data); MidOrderTraverse(T->rchild,Visit); } } //后序递归遍历 void PostOrderTraverse(BiTree T,int(* Visit)(char e)){ if(T){ MidOrderTraverse(T->lchild,Visit); MidOrderTraverse(T->rchild,Visit); Visit(T->data); } }