```
def isBalanced(self, root):
if self.checkHeight(root) == -1:
return False
else:
return True
def checkHeight(self, root):
if root == None:
return 0
leftHeight = self.checkHeight(root.left)
if leftHeight == -1:
return -1
rightHeight = self.checkHeight(root.right)
if rightHeight == -1:
return -1
diffHeight = abs(leftHeight - rightHeight)
if diffHeight > 1:
return -1
else:
return max(leftHeight, rightHeight) + 1
```