Skip to content

Instantly share code, notes, and snippets.

@wesen
Created October 31, 2016 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wesen/2963734f0e552b3239bd90f6ae2e637e to your computer and use it in GitHub Desktop.
Save wesen/2963734f0e552b3239bd90f6ae2e637e to your computer and use it in GitHub Desktop.
pub fn new() -> Trie {
let mut t = Trie {
children: Vec::with_capacity(26),
// children: vec![None; 26],
cnt: 0,
children_cnt: 0
};
for _ in 0..26 {
t.children.push(None);
}
t
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment