What is a trie?

A trie is a data structure that allows storing sets of strings. Tries let you:

How do tries work?

Observe the following diagram containing "do", "dog", "dot", "doting", "drag", "drastic", "to", "top", "torn", and "trap". Note that the data is stored in the edges, not the nodes:

For more information on tries, see here

Image credit