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

Method deleteMin

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

Source from the content-addressed store, hash-verified

92 }
93
94 public void deleteMin() {
95 if (isEmpty()) return;
96
97 // if both children of root are black, set root to red
98 if (!isRed(root.left) && !isRed(root.right))
99 root.color = RED;
100
101 root = deleteMin(root);
102 if (!isEmpty()) root.color = BLACK;
103 // assert check();
104 }
105
106 private Node deleteMin(Node h) {
107 if (h.left == null)

Callers 1

deleteMethod · 0.95

Calls 4

isEmptyMethod · 0.95
isRedMethod · 0.95
moveRedLeftMethod · 0.95
balanceMethod · 0.95

Tested by

no test coverage detected