r""" A A Br / \ / \ / \ B C LR Br C RR B A / \ --> / \ --> / / \ Bl Br B UB Bl UB C \ /
(node: MyNode)
| 124 | |
| 125 | |
| 126 | def lr_rotation(node: MyNode) -> MyNode: |
| 127 | r""" |
| 128 | A A Br |
| 129 | / \ / \ / \ |
| 130 | B C LR Br C RR B A |
| 131 | / \ --> / \ --> / / \ |
| 132 | Bl Br B UB Bl UB C |
| 133 | \ / |
| 134 | UB Bl |
| 135 | RR = right_rotation LR = left_rotation |
| 136 | """ |
| 137 | left_child = node.get_left() |
| 138 | assert left_child is not None |
| 139 | node.set_left(left_rotation(left_child)) |
| 140 | return right_rotation(node) |
| 141 | |
| 142 | |
| 143 | def rl_rotation(node: MyNode) -> MyNode: |
no test coverage detected