MCPcopy Index your code
hub / github.com/douchuan/algorithm / insert1

Function insert1

tests/test_rb_tree2.rs:19–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17/// P440
18#[test]
19fn insert1() {
20 let mut tree = Tree::default();
21 for v in "SEARCHXMPL".chars() {
22 tree.insert(v, v);
23 }
24
25 let r = unsafe { PreOrderVisitor::iterate(&tree) };
26 assert_eq!(r.iter().collect::<String>(), "MECALHRPXS");
27 let r = unsafe { InOrderVisitor::iterate(&tree) };
28 assert_eq!(r.iter().collect::<String>(), "ACEHLMPRSX");
29}
30
31#[test]
32fn insert2() {

Callers

nothing calls this directly

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected