Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Use nested child pointers under each node. Insert writes each character path and marks the terminal node. Search/startsWith walk the same path and check terminal or complete prefix existence.
Shared prefixes are stored once in the tree, and every query touches at most L nodes for an L-length word.
Updated Feb 2026