MCPcopy Create free account
hub / github.com/anupam-kumar-krishnan/Competitive_Programming / insert

Method insert

All Data Structures/TREE/AVL.cpp:91–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 return t;
90}
91avl *avl_tree::insert(avl *r, int v) {
92 if (r == NULL) {
93 r = new avl;
94 r->d = v;
95 r->l = NULL;
96 r->r = NULL;
97 return r;
98 } else if (v< r->d) {
99 r->l = insert(r->l, v);
100 r = balance(r);
101 } else if (v >= r->d) {
102 r->r = insert(r->r, v);
103 r = balance(r);
104 } return r;
105}
106void avl_tree::show(avl *p, int l) {
107 int i;
108 if (p != NULL) {

Callers 15

printPairsFunction · 0.45
subArrayExistsFunction · 0.45
unionsolveFunction · 0.45
intsolveFunction · 0.45
mainFunction · 0.45
subArrayExistsFunction · 0.45
doUnionsMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
detectLoopFunction · 0.45
sumEvenAfterQueriesMethod · 0.45
plusOneMethod · 0.45

Calls 1

insertFunction · 0.50

Tested by 1

shortestPathLengthMethod · 0.36