摘要:
1.先序遍历非递归算法#define maxsize 100typedef struct{Bitree Elem[maxsize];int top;}SqStack;void PreOrderUnrec(Bitree t){SqStack s;StackInit(s);p=t;while (p!=null || !StackEmpty(s)){while (p!=null) //遍历左子树{visite(p->data);push(s,p);p=p->lchild; }//endwhileif (!StackEmpty(s)) //通过下一次循环中的内嵌while实现右子树遍历{ 阅读全文