- java.lang.Object
-
- com.github.underscore.Trie
-
public class Trie extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Trie.TrieNode
-
Constructor Summary
Constructors Constructor Description Trie()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
insert(String word)
boolean
search(String word)
boolean
search(String word, Trie.TrieNode root, int idx)
boolean
startsWith(String prefix)
-
-
-
Method Detail
-
insert
public void insert(String word)
-
search
public boolean search(String word)
-
search
public boolean search(String word, Trie.TrieNode root, int idx)
-
startsWith
public boolean startsWith(String prefix)
-
-