자료구조1 [자료구조] Trie 구현 with Java TrieNode public class TrieNode { private final Map child; private boolean isLast; public TrieNode() { child = new HashMap(); isLast = false; } public TrieNode insert(Character character) { return child.computeIfAbsent(character, c -> new TrieNode()); } public boolean isLast() { return isLast; } public void setLast(boolean isLast) { this.isLast = isLast; } public boolean contains(Character charac.. 2020. 10. 12. 이전 1 다음