C solution
\nint max(int a, int b) {\n    return a >= b ? a : b;\n}\n\nint height(struct TreeNode* root) {\n    if (root == NULL)\n        return 0;\n    else\n        ret
```\nint max(int a, int b) {\n    return a >= b ? a : b;\n}\n\nint height(struct TreeNode* root) {\n    if (root == NULL)\n        return 0;\n    else\n        return 1 + max(height(root->left), height(root->right));\n}\n\nbool isBalanced(struct TreeNode* root){\n    if (root == NULL)\n        return 1;\n    int left = height(root->left);\n    int right = height(root->right);\n    return abs(left - right) <= 1 && isBalanced(root->left) && isBalanced(root->right);\n}\n```
[]