To traverse a non-empty tree in inorder the following steps are followed recursively.
- Visit the Root
- Traverse the left subtree
- Traverse the right subtree
The inorder traversal of the tree shown below is as follows.
The algorithm for inorder traversal is as follows.
struct node * lc;
struct node * rc;
void inorder(struct node * root);
if(root != NULL)
So the function calls itself recursively and carries on the traversal.