A simple implementation of trie
C++
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitattributes
.gitignore
README.md
trie.cpp

README.md

trie-simple-implementation

A simple implementation of trie

A Trie supporting the following operations for n words with lengths k Only words of small latin alphabets are supported. To modify it to work for other, you will have to map the child array indexes properly

  1. insert - O(k)
  2. search - O(k)
  3. count of words with a given prefix of length k - O(k)

Try this code with inputs at http://ideone.com/UkyE2