def update_heights(self, recursive=True):
if self.node:<EOL><INDENT>if recursive:<EOL><INDENT>if self.node.left:<EOL><INDENT>self.node.left.update_heights()<EOL><DEDENT>if self.node.right:<EOL><INDENT>self.node.right.update_heights()<EOL><DEDENT><DEDENT>self.height = <NUM_LIT:1> + max(self.node.left.height, self.node.right.height)<EOL><DEDENT>else:<EOL><INDENT>self.height = -<NUM_LIT:1><EOL><DEDENT>
Update tree height