Tree: Height of a Binary Tree

  • + 0 comments
    def height(root):
        if not root:
            return -1
        return max(height(root.left), height(root.right)) + 1