Implement DFS and tree algorithms | Amazon