帮我看一下非递归遍历二叉数的算法
hanzq 2004-05-07 08:04:47 struct btnode
{ char data;
struct btnode * lchild;
struct btonde * rchild;
};
struct node
{ struct btnode *addr;
struct node *link;
};
inorder(root)
struct btnode * root;
{
struct node *top,*p;
top=NULL;
while(root!=NULL||top!=NULL)
{
while(root!=NULL)
{
struct node * p=(struct node *)malloc(sizeof(struct node));
p->addr=root;
p->link=top;
top=p;
root=root->lchild;
}
if(top!=NULL)
{
root=top->addr;
printf("%c",root->data);
p=top;
top=top->link;
free(p);
root=root->rchild;
}
}return;
}
这段代码编译出错 :“undefimed structure 'btonde' in function inorder”
其他没有语法错误
怎么改?