اجرای Trie در c++ با استفاده از std:: vector.
``` #include <vector> #include <iostream> با استفاده از namespace std; const int MAX_CHAR = 26; struct TrieNode { vector<TrieNode*> children; bool isEnd; TrieNode ((()): children(MAX_CHAR, nullptr), isEnd(false) {} }; class Trie { public: Trie() { root = new TrieNode ((); } void insertstring word) { TrieNode*Node = root; for (char c: word) { int index = c - 'a'; if (currNode->children[index] == nullptr) { currNode->children[index] false new TrieNode null; isEnd (nullptr); isEnd (null)) { { {