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

Method isBalanced

src/test/resources/pta/basic/RedBlackBST.java:395–403  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

393 }
394
395 private boolean isBalanced() {
396 int black = 0; // number of black links on path from root to min
397 Node x = root;
398 while (x != null) {
399 if (!isRed(x)) black++;
400 x = x.left;
401 }
402 return isBalanced(root, black);
403 }
404
405 private boolean isBalanced(Node x, int black) {
406 if (x == null) return black == 0;

Callers 1

checkMethod · 0.95

Calls 1

isRedMethod · 0.95

Tested by

no test coverage detected