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

Function rightRotate

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

Source from the content-addressed store, hash-verified

126 return temp
127}
128const rightRotate = function (node) {
129 const temp = node._left
130 node._left = temp._right
131 temp._right = node
132 updateHeight(node)
133 updateHeight(temp)
134 return temp
135}
136
137// check if tree is balanced else balance it for insertion
138const insertBalance = function (node, _val, balanceFactor, tree) {

Callers 2

insertBalanceFunction · 0.85
delBalanceFunction · 0.85

Calls 1

updateHeightFunction · 0.85

Tested by

no test coverage detected