Tries

A trie is a tree-like data structure in which data is stored in association with keys, which are typically strings. Tries are made of nodes, usually consisting of an array of pointers to other nodes and one other field that gives the programmer more information about the node and indicates if that node represents a key. Tries use large amounts of memory, but trade this for constant time (O(1)) lookup and insertion. In this section, we will discuss the basics of tries, and see an example for their implementation, in a dictionary.