MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / main

Function main

code/chapter09/trie.rs:56–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54}
55
56fn main() {
57 let mut trie = Trie::new();
58 trie.insert("box"); trie.insert("insert");
59 trie.insert("apple"); trie.insert("appeal");
60
61 let res1 = trie.search("apple");
62 let res2 = trie.search("apples");
63 let res3 = trie.start_with("ins");
64 let res4 = trie.start_with("ina");
65 println!("word 'apple' in Trie: {res1}");
66 println!("word 'apples' in Trie: {res2}");
67 println!("prefix 'ins' in Trie: {res3}");
68 println!("prefix 'ina' in Trie: {res4}");
69}

Callers

nothing calls this directly

Calls 3

insertMethod · 0.45
searchMethod · 0.45
start_withMethod · 0.45

Tested by

no test coverage detected