Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Map;
- import java.util.HashMap;
- public class CompressedTrie {
- public Map<String, CompressedTrie> children;
- public CompressedTrie() {
- children = new HashMap<String, CompressedTrie>();
- }
- public static CompressedTrie compressTrie(Trie trie) {
- CompressedTrie CT = new CompressedTrie();
- int len = trie.children.length;
- for(int i = 0 ; i < len; i++){
- CT.children.put(trie.string + '{', CT);
- }
- return CT;
- }
- public boolean query(String s) {
- return false;
- }
- public void insert(String s) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement