Skip to main content

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


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)

Uploaded Source

Built Distribution

shtrie-0.1.0-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page