Example & Tutorial understanding programming in easy ways.

What is In-order traversal of binary search tree?

In-order traversal:
In-order traversal of Binary search tree is follow the pattern "LEFT ROOT RIGHT"
-That means, we can evalute left portion then root then right portion.

Following is the function that are used to traverse the Binary search Tree in In-order:

void traverse(struct node *root)
{
if(root!=NULL)
{
traverse(root->leftchild);
printf("%d ",root->data);
traverse(root->rightchild);
}
}

Note:
In-order traversal of BST are always in increasing order




Read More →