Genera una funzione per verificare se un albero binario è bilanciato o meno.
def isBalanced(root):
    if root is None:
        return True
    lh = height(root.left)
    rh = height(root.right)

    if (abs(lh - rh) <= 1) and isBalanced(root.left) is True and isBalanced(root.right) is True:
        return True

    return False

def height(node):
    if node is None:
        return 0
    return 1 + max(height(node.left), height(node.right))

Traduci il seguente testo in italiano: 'def isBalanced(root):
    if root is None:
        return True
    lh = height(root.left)
    rh = height(root.right)
  
    if (abs(lh - rh) <= 1) and isBalanced(root.left) is True and isBalanced(root.right) is True:
        return True
  
    return False
  
def height(node):
    if node is None:
        return 0
    return 1 + max(height(node.left), height(node.right))'