void pre_order (BTreeNode *node)
{
if (node == NULL)
{
errno = ERROR;
return;
}
LinkStack *Stack = Create_Stack ();
BTreeNode *tmp = node; //指向当前节点
while (tmp)
{
printf("L",tmp->data);
Push (Stack,tmp);
if (tmp->lchild)
{
tmp = tmp->lchild;
continue;
}
while(StackEmpty(Stack) != TRUE)
{
Pop (Stack,&tmp);
if(tmp = tmp->rchild)
{
break;
}
}
}
}