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

Method heapify

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

Source from the content-addressed store, hash-verified

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); }
55 void update_key(int n) {
56 assert(loc[n] != -1), swim(loc[n]), sink(loc[n]); }
57 bool empty() { return count == 0; }

Callers

nothing calls this directly

Calls 1

cmpClass · 0.70

Tested by

no test coverage detected