Tries and prefix trees: autocomplete to compressed tries

11 steps · about 3 h 18 min · Intermediate

  1. Tries in 2 Minutes (video, YouTube, 3 min)

    A quick picture of what a trie is and why prefix search is fast, before you read any code.

  2. Trie (reference, Wikipedia, 15 min)

    Gives you the standard definitions, the history, and the link to radix trees.

  3. 8.1 Trie Data Structure (video, YouTube, 20 min)

    A longer walkthrough of why tries exist, the node structure, and insert, search and delete.

  4. Trie Data Structure Implementation (article, AlgosWithMichael, 15 min)

    Covers insert, search and startsWith with their time and space complexity.

  5. Trie Data Structure — Insert, Search, Starts With, Autocomplete (article, skills101, 20 min)

    Adds per-node prefix counts and autocomplete, with Python and Java code.

  6. Module A-10: Tries: Prefix Trees and Autocomplete (tutorial, Data Structures and Algorithms In-Depth, 25 min)

    Explains why hash maps can't answer prefix queries, then builds autocomplete as walk-then-collect.

  7. Trie Data Structure: Prefix Search and Autocomplete (article, Raghuveer, 20 min)

    Ranks suggestions by frequency, as a real search box does, and previews the compact trie.

  8. Radix Tree [Compact version of Trie] (article, OpenGenus, 20 min)

    Shows how edges hold whole strings, with search and insert examples.

  9. Compressed Tries - GeeksforGeeks (article, GeeksforGeeks, 10 min)

    Compares standard and compressed tries on memory and speed.

  10. Radix tree (reference, Wikipedia, 15 min)

    Formal treatment of radix trees, their operations, and variants such as HAT-tries.

  11. Trie in Depth: Prefix Trees From First Principles to Radix Trees, Autocomplete and Longest-Prefix Match (article, Belgavi.AI Lab, 35 min)

    Final step: cached top-k autocomplete, deletion and longest-prefix match in one article.