Depth First Traversal

This type of traversal explores a branch fully before moving on to a different branch. It has three main versions, depending on when you visit the node itself (the “parent”) relative to its children:

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