(self, node)
| 77 | self.updateBalance(currentNode.rightChild) |
| 78 | |
| 79 | def updateBalance(self, node): |
| 80 | if node.balanceFactor > 1 or node.balanceFactor < -1: |
| 81 | self.rebalance(node) |
| 82 | return |
| 83 | if node.parent != None: |
| 84 | if node.isLeftChild(): |
| 85 | node.parent.balanceFactor += 1 |
| 86 | elif node.isRightChild(): |
| 87 | node.parent.balanceFactor -= 1 |
| 88 | |
| 89 | if node.parent.balanceFactor != 0: |
| 90 | self.updateBalance(node.parent) |
| 91 | |
| 92 | def rotateLeft(self, rotRoot): |
| 93 | newRoot = rotRoot.rightChild |
no test coverage detected