Inorder Traversal :
Print this page
 

Algorithm
The algorithm for inorder traversal is as follows.

Struct node
{
struct node * lc;
int data;
struct node * rc;
};

void inorder(struct node * root);
{
if(root != NULL)
{
inorder(roo-> lc);
printf("%d\t",root->data);
inorder(root->rc);
}
}

So the function calls itself recursively and carries on the traversal.

 
Prev
Next