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

Function insert2

tests/test_rb_tree2.rs:32–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30
31#[test]
32fn insert2() {
33 let mut tree = Tree::default();
34 for v in "ACEHLMPRSX".chars() {
35 tree.insert(v, v);
36 }
37
38 let r = unsafe { PreOrderVisitor::iterate(&tree) };
39 assert_eq!(r.iter().collect::<String>(), "HCAERMLPXS");
40 let r = unsafe { InOrderVisitor::iterate(&tree) };
41 assert_eq!(r.iter().collect::<String>(), "ACEHLMPRSX");
42}
43
44#[test]
45fn repeat_insert() {

Callers

nothing calls this directly

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected