MCPcopy Create free account
hub / github.com/GateNLP/gate-core / computeRedLevel

Method computeRedLevel

src/main/java/gate/util/RBTreeMap.java:1710–1715  ·  view source on GitHub ↗

Find the level down to which to assign all nodes BLACK. This is the last `full' level of the complete binary tree produced by buildTree. The remaining nodes are colored RED. (This makes a `nice' set of color assignments wrt future insertions.) This level number is computed by finding the number of

(int sz)

Source from the content-addressed store, hash-verified

1708 * quick O(lg(N)) loop.)
1709 */
1710 private static int computeRedLevel(int sz) {
1711 int level = 0;
1712 for (int m = sz - 1; m >= 0; m = m / 2 - 1)
1713 level++;
1714 return level;
1715 }
1716
1717} // class RBTreeMap

Callers 1

buildFromSortedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected