Consider the following code:
public int heightOfBinaryTree(Node node) { if (node == null) { return 0; } else { return 1 +
It's a recursive function. It's saying the height of a tree is 1 + the height of its tallest branch.
Is BFS a breadth first search? I'm not sure what difference there would be in efficiency, but I like the simplicity of the recursive function.