Skip to content

Instantly share code, notes, and snippets.

@theodoregoetz
Created October 22, 2015 18:09
Show Gist options
  • Save theodoregoetz/7532d550c1e8ab9413da to your computer and use it in GitHub Desktop.
Save theodoregoetz/7532d550c1e8ab9413da to your computer and use it in GitHub Desktop.
A Trie using C++11
#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