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

Method sink

src/test/resources/cha/MaxPQ.java:126–134  ·  view source on GitHub ↗
(int k)

Source from the content-addressed store, hash-verified

124 }
125
126 private void sink(int k) {
127 while (2 * k <= n) {
128 int j = 2 * k;
129 if (j < n && less(j, j + 1)) j++;
130 if (!less(k, j)) break;
131 exch(k, j);
132 k = j;
133 }
134 }
135
136 /***************************************************************************
137 * Helper functions for compares and swaps.

Callers 2

MaxPQMethod · 0.95
delMaxMethod · 0.95

Calls 2

lessMethod · 0.95
exchMethod · 0.95

Tested by

no test coverage detected