CS/Data Structure 썸네일형 리스트형 [자료구조] Trie 트라이 #include #pragma warning(disable:4996) using namespace std; const int ALPHABET_SIZE = 26; struct Trie { bool isEnd; int childCnt; Trie *child[ALPHABET_SIZE] = {}; Trie() { isEnd = false; childCnt = 0; for (Trie *node : child) node = NULL; } void Insert(string str) { Trie* ch = this; for (int idx = 0; idx child[now] == NULL) { ch->child[now.. 더보기 이전 1 다음