Anonymous
public java v1 · immutable public int getTreeHeight() { if(root != null) { return 1+Math.max(getTreeHeight(root.right),getTreeHeight(root.left)); } else { return 0; } } private int getTreeHeight(Node currentNode) { if(currentNode == null) { return 0; } else { return 1+Math.max(getTreeHeight(currentNode.left),getTreeHeight(currentNode.right)); } }