Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import java.util.Map;
  2. import java.util.HashMap;
  3.  
  4. public class CompressedTrie {
  5. public Map<String, CompressedTrie> children;
  6. public CompressedTrie() {
  7. children = new HashMap<String, CompressedTrie>();
  8. }
  9. public static CompressedTrie compressTrie(Trie trie) {
  10. CompressedTrie CT = new CompressedTrie();
  11. int len = trie.children.length;
  12. for(int i = 0 ; i < len; i++){
  13. CT.children.put(trie.string + '{', CT);
  14. }
  15. return CT;
  16. }
  17.  
  18. public boolean query(String s) {
  19. return false;
  20. }
  21. public void insert(String s) {
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement