Created
October 22, 2015 18:09
-
-
Save theodoregoetz/7532d550c1e8ab9413da to your computer and use it in GitHub Desktop.
A Trie using C++11
This file contains 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 <unordered_map> | |
#include <memory> | |
using namespace std; | |
struct Node { | |
bool end; | |
unordered_map<char,unique_ptr<Node>> children; | |
Node() : end(false), children() {} | |
}; | |
typedef unordered_map<char,unique_ptr<Node>> Trie; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment