MCPcopy Create free account
hub / github.com/douchuan/algorithm / delete_min

Method delete_min

src/tree/binary/rb2.rs:136–147  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

134 }
135
136 fn delete_min(&mut self) {
137 let mut root = NodeQuery::new(self.root);
138 if root.is_some() {
139 if !root.left().is_red() && !root.right().is_red() {
140 root.set_color(Color::Red);
141 }
142 root.node = del_min(root.node);
143 root.set_color(Color::Black);
144 self.root = root.node;
145 self.set_size(self.size() - 1);
146 }
147 }
148
149 fn delete_max(&mut self) {
150 let mut root = NodeQuery::new(self.root);

Callers 1

delete_minFunction · 0.80

Calls 8

del_minFunction · 0.85
is_someMethod · 0.80
is_redMethod · 0.80
set_colorMethod · 0.80
set_sizeMethod · 0.80
leftMethod · 0.45
rightMethod · 0.45
sizeMethod · 0.45

Tested by 1

delete_minFunction · 0.64