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

Function t_pop

src/tree/binary/builder/tournament.rs:169–182  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167
168#[test]
169fn t_pop() {
170 let mut a = vec![7, 6, 15, 16, 8, 4, 13, 3, 5, 10, 9, 1, 12, 2, 11, 14];
171 let mut tree: Tree<i32, i32> = do_build(&a);
172
173 //make a desc sorted
174 a.sort();
175 a.reverse();
176
177 for v in a {
178 assert_eq!(pop(&mut tree), Some(v));
179 }
180
181 assert_eq!(pop(&mut tree), None);
182}

Callers

nothing calls this directly

Calls 3

do_buildFunction · 0.85
sortMethod · 0.45
reverseMethod · 0.45

Tested by

no test coverage detected