MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / getHeightDifference

Function getHeightDifference

Data-Structures/Tree/AVLTree.js:103–105  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

101
102// height difference or balance factor of a node
103const getHeightDifference = function (node) {
104 return node == null ? 0 : getHeight(node._left) - getHeight(node._right)
105}
106
107// update height of a node based on children's heights
108const updateHeight = function (node) {

Callers 2

delBalanceFunction · 0.85
insertFunction · 0.85

Calls 1

getHeightFunction · 0.85

Tested by

no test coverage detected