Pre-Order Traversal of Binary Tree | Easy Way To Learn

There are three types of Binary tree traversal algorithm:

  1. Pre-order traversal
  2. Post-order traversal
  3. In-order traversal

In this post we are going to learn how to traverse the binary tree using pre-order traversal technique:

Algorithm/Formula – Root + Left Sub-tree + Right Sub-tree

  1. Visit the root node first
  2. From the visited root node, go to left sub-tree and apply the formula again.
  3. When the left sub-tree is completed visit the right sub-tree and apply the formula again.

This method is well explained in the below video and easy to remember:

Leave a Reply

Your email address will not be published. Required fields are marked *