Skip to main content
←
Architecture Workspace
Arch
OS
Workspaces
/
Search blueprints, commands…
⌘K
Build
Learn
Blueprint
▾
Share
Sign in
Menu ▾
ArchOS Studio
Hydrating 525 executable blueprints & local workspace…
ALGORITHM CANVAS · TRIE / RADIX TREE · TIME O(L) · SPACE O(Σ · N)
Prefix Trie & Longest-Prefix Autocomplete
Solve Timed Cold Drill →
✕ Topology View
Share common character prefixes along tree edges so lookup and autocomplete scale with key length L rather than dictionary size N.
NODES TREE (3 ACTIVE NODES)
root
r
ra
◀ Prev
▶ Play
Next ▶
STEP 1/4 · L9
1x
nodes
=["root","r","ra"]
inserted
=["ra"]
PYTHON 3.12 · INSTANT PREVIEW
▸ Trace Live Python (Pyodide)
1
def build_trie_trace(words):
2
nodes = ["root"]
3
inserted = []
4
for w in words:
5
prefix = ""
6
for ch in w:
7
prefix += ch
8
if prefix not in nodes:
9
nodes.append(prefix)
10
inserted.append(w)
11
return nodes
CALL: