struct node
{
struct treenode *lchild;
char data;
struct treenode *rchild;
};
Procedure for Recursive Preorder
void rpreorder(struct node *p)
{
if (p!=NULL)
{
printf("%c ",p->data);
rpreorder(p->lchild);
rpreorder(p->rchild);
}
}
Procedure for Recursive Inorder
void rinorder(struct treenode *p)
{
if (p!=NULL)
{
rinorder(p->lchild);
printf("%c ",p->data);
rinorder(p->rchild);
}
}
Procedure for Recursive Postorder
void rpostorder(struct node *p)
{
if (p!=NULL)
{
rpostorder(p->lchild);
rpostorder(p->rchild);
printf("%c ",p->data);
}
}
If the answers is incorrect or not given, you can answer the above question in the comment box. If the answers is incorrect or not given, you can answer the above question in the comment box.