while(p || !StackEmpty(S)) { if(p) { push(S,p); p = p->lchild; } else if(GetTop(S)->rchild) { p=GetTop->rchild; } else if(!GetTop(S)->rchild) { while(1) { pop(S,p); visit(p); p=GetTop(S); if(!p->rchild) continue; p=p->rchild; break; } } }