Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Implement Trie (Prefix Tree)
Bookmark
Input
Standard
Multiple Words
Not Found
Custom
operations
=
[Trie, insert, insert, search, search, startsWith, startsWith]
,
values
=
[null, apple, app, apple, app, app, ap]
Operation
-
Word/Prefix
-
Result
-
*
Operation
-
Word/Prefix
-
Result
-
*
Operation
insert
Word/Prefix
"apple"
Result
-
*
a
p
Operation
insert
Word/Prefix
"apple"
Result
-
*
a
p
p
l
e
Operation
insert
Word/Prefix
"app"
Result
-
*
a
p
p
l
e
Operation
search
Word/Prefix
"apple"
Result
-
*
a
p
p
l
e
Operation
search
Word/Prefix
"apple"
Result
-
*
a
p
p
l
e
Operation
search
Word/Prefix
"app"
Result
-
*
a
p
p
l
e
Operation
startsWith
Word/Prefix
"app"
Result
-
*
a
p
p
l
e
Operation
startsWith
Word/Prefix
"ap"
Result
-
*
a
p
p
l
e
Operation
startsWith
Word/Prefix
"ap"
Result
true
*
a
p
p
l
e
algo
master
.
io
Step:
Initialize Trie with root node
0 / 57
Input
Standard
Multiple Words
Not Found
Custom
operations
=
[Trie, insert, insert, search, search, startsWith, startsWith]
,
values
=
[null, apple, app, apple, app, app, ap]
0 / 57
algo
master
.
io
Step:
Initialize Trie with root node