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

Function nodeHeight

CPP/AVL Trees/AVL_Trees.cpp:19–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18template <typename T>
19int nodeHeight(Node<T> *p){
20 int hl, hr;
21 hl = p && p -> lchild ? p -> lchild -> height : 0;
22 hr = p && p -> rchild ? p -> rchild -> height : 0;
23
24 return max(hl + 1, hr + 1);
25}
26
27
28template <typename T>

Callers 2

LLRotationFunction · 0.85
insert_bst_recursiveFunction · 0.85

Calls 1

maxFunction · 0.50

Tested by

no test coverage detected