33,008
社区成员
发帖
与我相关
我的任务
分享
void ldr(BiTree T) {
BiTree t = T;
Stack S = createStackNode();
printf("中序遍历:");
while (t != NULL || isStackEmpty(S) == FALSE) {
if (t != NULL) {
push(S, t);
t = t->lchild;
} else {
t = pop(S);
printf(" %c", t->data);
t = t->rchild;
}
}
printf("\n");
clearStack(S);
}