MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / pop

Method pop

code/data-structures/heap.cpp:47–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 loc[n] = count, q[count++] = n;
46 if (fix) swim(count-1); }
47 void pop(bool fix = true) {
48 assert(count > 0);
49 loc[q[0]] = -1, q[0] = q[--count], loc[q[0]] = 0;
50 if (fix) sink(0);
51 }
52 int top() { assert(count > 0); return q[0]; }
53 void heapify() { for (int i = count - 1; i > 0; i--)
54 if (cmp(i, (i - 1) / 2)) swp(i, (i - 1) / 2); }

Callers 11

countMethod · 0.45
aho_corasickMethod · 0.45
gift_wrapFunction · 0.45
stable_marriageFunction · 0.45
queryMethod · 0.45
testFunction · 0.45
random_treeFunction · 0.45
lca_treeMethod · 0.45
sccFunction · 0.45
euler_pathFunction · 0.45
tsortFunction · 0.45

Calls

no outgoing calls

Tested by 4

queryMethod · 0.36
testFunction · 0.36
random_treeFunction · 0.36
lca_treeMethod · 0.36