DFS search algorithm on binary tree