From 53b968e36ce899aaf64537ccb15492bee9c10319 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 30 Jun 2024 12:36:17 +0100 Subject: [PATCH] posts: trie: add presentation --- content/posts/2024-06-30-trie/index.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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