DFS and BFS on trees, with and without recurssion