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

Function getBalance

Trees/avltree.c:71–76  ·  view source on GitHub ↗

Get the balance factor

Source from the content-addressed store, hash-verified

69
70// Get the balance factor
71int getBalance(struct Node *N)
72{
73 if (N == NULL)
74 return 0;
75 return height(N->left) - height(N->right);
76}
77
78// Insert node
79struct Node *insertNode(struct Node *node, int key)

Callers 2

insertNodeFunction · 0.85
deleteNodeFunction · 0.85

Calls 1

heightFunction · 0.70

Tested by

no test coverage detected