This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
#define SIZE 26 | |
using namespace std; | |
struct TrieNode { | |
TrieNode* child[SIZE] = {}; | |
bool isEndofWord = false; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <memory> | |
#define SIZE 26 | |
using namespace std; | |
class TrieNode { | |
public: | |
shared_ptr<TrieNode> child[SIZE]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <unordered_map> | |
using namespace std; | |
struct TrieNode { | |
unordered_map<char,TrieNode*> child; | |
bool isEndofWord = false; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <unordered_map> | |
using namespace std; | |
struct TrieNode { | |
unordered_map<char,TrieNode*> {}; | |
bool isEndofWord = false; | |
}; |