MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / insert

Function insert

Data Structures/Treap persistent.cpp:66–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 return t;
65}
66node* insert(node* t, int pos, int val) {
67 node *l, *r;
68 split(t, pos - 1, l, r);
69 return merge(merge(l, new node(val)), r);
70}
71node* insert(node* t, int pos, node* x) {
72 node *l, *r;
73 split(t, pos - 1, l, r);

Callers 1

mainFunction · 0.70

Calls 2

splitFunction · 0.70
mergeFunction · 0.70

Tested by

no test coverage detected