Preorder Traversal | Postorder Traversal | Inorder Traversal

  1. Traverse the left subtree.
  2. Visit the root.
  3. Traverse the right subtree.
For those of us who are visual learners, the inorder traversal of a binary tree would look like this.

           C     depth = 0
          / \
         B   E   depth = 1
        /   / \
       A   D   F depth = 2