MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / balanceFactor

Function balanceFactor

CPP/AVL Trees/AVL_Trees.cpp:29–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28template <typename T>
29int balanceFactor(Node<T> *p){
30 int hl, hr;
31 hl = p && p -> lchild ? p -> lchild -> height : 0;
32 hr = p && p -> rchild ? p -> rchild -> height : 0;
33
34 return hl - hr;
35}
36
37template <typename T>
38Node<T>* LLRotation(Node<T>* p){

Callers 1

insert_bst_recursiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected