Binary Search Tree

Searching a node in BST

There are mainly three types of tree traversals:

  • Pre-order traversal: In this traversal technique the traversal order is root-left-right i.e.
    • Process data of root node
    • Traverse left subtree completely
    • Then, traverse right subtree
  • Post-order traversal: In this traversal technique the traversal order is left-right-root i.e.
    • Process data of left subtree
    • Traverse right subtree
    • Then, traverse root node
  • In-order traversal: In this traversal technique the traversal order is left-root-right i.e.
    • First process left subtree (before processing root node)
    • Traverse right subtree
    • Then, traverse root node