Single-hash-table Trie
Project description
shtrie
Single-hash-table Trie
Usage
>>> import shtrie
>>> trie = shtrie.list_to_trie([("CAT", 100), ("RAT", 200), ("DOG", 300)])
>>> from shtrie import PAYLOAD_KEY, ROW_KEY, TERMINAL_KEY
>>> from shtrie import lookup
>>> val0 = lookup(trie, 0, 0, "C")
>>> val0[TERMINAL_KEY]
False
>>> val1 = lookup(trie, val0[ROW_KEY], 1, "A")
>>> val2 = lookup(trie, val1[ROW_KEY], 2, "T")
>>> val2
(0, True, 100)
>>> lookup(trie, 0, 0, "O")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
shtrie-0.1.0.tar.gz
(6.2 kB
view hashes)
Built Distribution
shtrie-0.1.0-py3-none-any.whl
(6.3 kB
view hashes)