A class for building a tree data-structure with DFS and BFS search methods.