Home
Terms and Types
Binary Trees
Traversals
Quiz


    Breadth First Traversal:
      A Breadth First Traversal visits all the nodes at a particular level from left to right and then moves to the next level.
      The output will be A,B,D,C,E,H,F,G,H,I
    Depth First Traversal:
      Depth First Traversals A Depth First Traversal visits nodes throughout the levels until it reaches the bottom and then starts over with another subtree. There are a total of 8 depth first traversal methods.
      We will talk about three:
      In-order
      Pre-order
      Post-order
    In-order Traversal:
      In-order Traversal An In-order Traversal visits the nodes in ascending order.
      First you visit the left subtree, then the root (or parent node), and then the right subtree (recursively).
      The output for this traversal would be B,C,A,F,E,G,D,I,H
    Pre Order Traversal:
      Pre-order Traversal processes each node as it is visited.
      First you visit the root (or parent node), then the left subtree, and then the right subtree (recursively).
      The output for this traversal would be A,B,C,D,E,F,G,H,I
    Post Order Traversal:
      Prost-order Traversal does not process a node until all of it’s children have been visited
      First you visit the left subtree, then the right subtree, and then the root (or parent node) (recursively).
      The output for this traversal would be C,B,F,G,E,I,H,D,A