Implement Trie — interactive algorithm visualization
Medium · Trie · time O(L) · space O(N·L)
Insert words into a prefix tree, then test a prefix by walking character edges. Shared prefixes share nodes.
Example input: words = ["cat","car","dog"], prefix = "ca"
Step through a verified execution trace - every step shows the real state, the invariant that keeps the algorithm correct, and asks you to predict what happens next.