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

Function insert

CPP/Trees/kthMinimumElement.cpp:19–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 return temp;
18}
19struct node *insert(struct node *node, int key)
20{
21 if (node == NULL)
22 return newNode(key);
23
24 if (key < node->key)
25 node->left = insert(node->left, key);
26 else if (key > node->key)
27 node->right = insert(node->right, key);
28
29 return node;
30}
31void saveNode(struct node *root, vector<struct node *> &nodes)
32{
33 if (root == NULL)

Callers 1

mainFunction · 0.70

Calls 1

newNodeFunction · 0.70

Tested by

no test coverage detected