def METHOD_NAME(self, n):
    x = n.left
    y = x.right
    # rotation
    x.right = n
    n.left = y
    n.height = 1 + max(self.getHeight(n.left), self.getHeight(n.right))
    x.height = 1 + max(self.getHeight(x.left), self.getHeight(x.right))
    return x