Reported interview periodNot available
Compressed prefix tree
Store sequences of integers so a shared beginning occupies one path. A plain trie uses one node per integer. Here, a run of nodes that each have only one child is stored as one edge.
Practice focusRequirements - Insert shares an edge when two sequences start the same way. A sequence with nothing in common gets its own branch. - Inserting a shorter sequence after a longer one must cut the long edge. - To cut an edge, walk until the new sequence disagrees. The shared head stays on the parent edge. The old tail becomes one child. The new tail becomes another. - A disagreement on the first integer splits that edge into a one-integer head plus two children. - Exact membership is true only for a sequence that was inserted, not for a proper head of one.…