ninorder

来源:互联网 发布:java 审批流程设计 编辑:程序博客网 时间:2024/04/30 00:27
void nInOrder(BinTree t)
{
    Stack s;
    BinTree c = t;
    if(t == NULL) return;
    s = CreateEmptyStack();
    do{
        while(c!=NULL)
        {
            push(s,c);
            c = leftChild(c);
        }
        c = top(s);
        pop(s);
      visit(root(c));
        c = rightChild(c);
    }while(c!=NULL||isEmptyStack(s));
}