def _balance_factor(node): ''' Returns the balance factor of a node. ''' if node is None: return 0 return BinaryTree._height(node.left) - BinaryTree._height(node.right)
def _balance_factor(node): if node is None: return 0 return BinaryTree._height(node.left) - BinaryTree._height(node.right)