Example & Tutorial understanding programming in easy ways.

What is postorder traversal of Binary search tree?

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

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

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




Read More →