MCPcopy Create free account
hub / github.com/LFYSec/MScan / delMax

Method delMax

src/test/resources/dataflow/constprop/alias/MaxPQ.java:41–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 }
40
41 public int delMax() {
42 if (isEmpty())
43 return MAGIC_NUMBER;
44 int max = pq[1];
45 exch(1, n--);
46 sink(1);
47 pq[n + 1] = MAGIC_NUMBER; // to avoid loitering and help with garbage collection
48 if ((n > 0) && (n == (pq.length - 1) / 4))
49 resize(pq.length / 2);
50 return max;
51 }
52
53 private void swim(int k) {
54 while (k > 1 && less(k / 2, k)) {

Callers 1

mainMethod · 0.95

Calls 4

isEmptyMethod · 0.95
exchMethod · 0.95
sinkMethod · 0.95
resizeMethod · 0.95

Tested by

no test coverage detected