//树的先序遍历(递归) void preorder(BTNode *T) { if(T!=NULL) { printf("%d ",T->data); preorder(T->firstchild); preorder(T->rightsib); } }
//树的先序遍历(非递归) void preorder2(PTree T) { int i; for(i=0;i<T.count;i++) { printf("%d ",T.node[i]); } }
//树后序遍历(递归)
void inoeder(BTNode *T) { if(T!=NULL) { inoeder(T->firstchild); printf("%d ",T->data); inoeder(T->rightsib); } }
//树后序遍历(非递归) void inoeder2(PTree T) { int i; for(i=T.count-1;i>=0;i--) { printf("%d ",T.node[i]); }
