Tree: Height of a Binary Tree

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