MCPcopy Index your code
hub / github.com/google/mangle / updateHeight

Function updateHeight

factstore/interval_tree.go:249–257  ·  view source on GitHub ↗

updateHeight updates the height of a node based on children.

(node *treeNode)

Source from the content-addressed store, hash-verified

247
248// updateHeight updates the height of a node based on children.
249func updateHeight(node *treeNode) {
250 left := height(node.left)
251 right := height(node.right)
252 if left > right {
253 node.height = 1 + left
254 } else {
255 node.height = 1 + right
256 }
257}
258
259// balanceFactor returns the balance factor of a node.
260func balanceFactor(node *treeNode) int {

Callers 3

rotateRightMethod · 0.85
rotateLeftMethod · 0.85
rebalanceMethod · 0.85

Calls 1

heightFunction · 0.85

Tested by

no test coverage detected