categories |
---|
tree,binary tree,depth-first search,breadth-first search,queue |
Explanation is pending. For now, you can check the solution:
- Solution.java - BFS solution utilizing a queue, stops when the first leaf node is reached.
- SolutionDFS.java - recursive solution employing DFS.Quite inefficient as it traverses each subtree first to calculate its depth before getting the minimum depth from the root.