Tree: Height of a Binary Tree

  • + 4 comments
    def height(root):
        if root is None:
            return -1
        return max(1 + height(root.left), 1 + height(root.right))