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

Method update_key

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

Source from the content-addressed store, hash-verified

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; }
58 int size() { return count; }
59 void clear() { count = 0, memset(loc, 255, len << 2); }};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected