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

Method deleteMax

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

Source from the content-addressed store, hash-verified

115 }
116
117 public void deleteMax() {
118 if (isEmpty()) return;
119
120 // if both children of root are black, set root to red
121 if (!isRed(root.left) && !isRed(root.right))
122 root.color = RED;
123
124 root = deleteMax(root);
125 if (!isEmpty()) root.color = BLACK;
126 // assert check();
127 }
128
129 private Node deleteMax(Node h) {
130 if (isRed(h.left))

Callers

nothing calls this directly

Calls 5

isEmptyMethod · 0.95
isRedMethod · 0.95
rotateRightMethod · 0.95
moveRedRightMethod · 0.95
balanceMethod · 0.95

Tested by

no test coverage detected