This post allows you to visualize how autocomplete data would be arranged within a Prefix Trie data structure. If you would like an introduction to Trie data structures before continuing, please check out Julia’s article on Medium.
Using the visualization
- The words can be changed on the fly; this will adjust the Trie diagram
- Sentences may be used instead of words
- The letters constituting each of the words are represented in the tree as nodes
- The end of each full word is marked on the node with the text “endWord”
Clicking on any of the nodes will trace down from that node. You will be shown the words and have an option to download them.
- This is the basis; we will expand on when we implement our autocomplete static file generator