notes:trie
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| notes:trie [2025/08/11 20:02] – created smj-edison | notes:trie [2025/08/11 20:11] (current) – smj-edison | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Trie ===== | + | ===== Moved to ===== |
| - | A Trie is the data structure that underlies Folk's database. It is the index to all Wishes, Claims, and Whens. | + | Moved to [[notes:internals:trie|Part 1: the Trie]] |
| - | + | ||
| - | Let's insert the Clause into the Trie and see what happens: | + | |
| - | + | ||
| - | {{notes:pxl_20250811_192744566.jpg? | + | |
| - | + | ||
| - | As you can see, the Clause has been turned into a set of nodes in the Trie. Let's try inserting another Clause, "the sky has clouds": | + | |
| - | + | ||
| - | {{notes: | + | |
| - | + | ||
| - | A Trie is just a tree, with each level being one word*. We've covered inserting, but what about querying? Let's try querying for "the sky has clouds" | + | |
| - | + | ||
| - | {{notes:trie-lookup-level-1.jpg? | + | |
| - | + | ||
| - | {{notes: | + | |
| - | + | ||
| - | {{notes: | + | |
| - | + | ||
| - | {{notes:trie-lookup-level-3-part-2.jpg? | + | |
| - | + | ||
| - | {{notes: | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | * Technically, | + | |
| - | + | ||
notes/trie.1754942528.txt.gz · Last modified: by smj-edison
