(node)
| 106 | |
| 107 | // update height of a node based on children's heights |
| 108 | const updateHeight = function (node) { |
| 109 | if (node == null) { |
| 110 | return |
| 111 | } |
| 112 | node._height = Math.max(getHeight(node._left), getHeight(node._right)) + 1 |
| 113 | } |
| 114 | |
| 115 | // Helper: To check if the balanceFactor is valid |
| 116 | const isValidBalanceFactor = (balanceFactor) => |
no test coverage detected