r''' A A Br / \ / \ / \ B C RR Br C LR B A / \ --> / \ --> / / \ Bl Br B UB Bl UB C \
(node)
| 101 | return ret |
| 102 | |
| 103 | def rlrotation(node): |
| 104 | r''' |
| 105 | A A Br |
| 106 | / \ / \ / \ |
| 107 | B C RR Br C LR B A |
| 108 | / \ --> / \ --> / / \ |
| 109 | Bl Br B UB Bl UB C |
| 110 | \ / |
| 111 | UB Bl |
| 112 | RR = rightrotation LR = leftrotation |
| 113 | ''' |
| 114 | node.setleft(rightrotation(node.getleft())) |
| 115 | return leftrotation(node) |
| 116 | |
| 117 | def lrrotation(node): |
| 118 | node.setright(leftrotation(node.getright())) |
no test coverage detected