diff --git a/content/posts/2024-06-30-trie/index.md b/content/posts/2024-06-30-trie/index.md index a4e8959..32b6fb8 100644 --- a/content/posts/2024-06-30-trie/index.md +++ b/content/posts/2024-06-30-trie/index.md @@ -21,3 +21,16 @@ structure most often used for string keys. [wiki]: https://en.wikipedia.org/wiki/Trie + +## What does it do? + +A _Trie_ can be used to map a set of string keys to their corresponding values, +without the need for a hash function. This also means you won't suffer from hash +collisions, though the tree-based structure will probably translate to slower +performance than a good hash table. + +A _Trie_ is especially useful to represent a dictionary of words in the case of +spell correction, as it can easily be used to fuzzy match words under a given +edit distance (think [Levenshtein distance]) + +[Levenshtein distance]: https://en.wikipedia.org/wiki/Levenshtein_distance