* Featured Image – “tree” by AmishHomo, used under CC BY 2.0

* The full working source code is available on GitHub *

I’ve forgotten most of the data structure concepts, especially a Tree structure. So I’ve been re-learning these concepts and would like to share how to traverse a Tree object.

There are two search methods, depth-first, and breath-first. I will only talk about depth-first search methods operating on a binary tree. A binary search tree is where “left node < parent < right node” as shown below.