Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 415 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 415 Bytes

Trie

This is a Python 3 implementation of a Trie data structure with no external dependencies.

Create trie

Create trie like this:

trie = Trie.Trie()

Insertion

Insert words into trie like this:

trie.insert(”word”)

Search

Search the trie for an exact match like this:

trie.search(”word”)

Search the tree for a prefix like this:

trie.startswith(”prefix”)