Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Implement Trie (Prefix Tree)
Bookmark
Brute Force
Word Set + Prefix Set
Trie
Input
Standard
Multiple Words
Not Found
Custom
operations
=
[Trie, insert, insert, search, search, startsWith, startsWith]
,
values
=
[null, apple, app, apple, app, app, ap]
Operation
Trie
Word/Prefix
-
Result
-
Stored words
(0)
No words inserted yet
Operation
Trie
Word/Prefix
-
Result
-
Stored words
(0)
No words inserted yet
Operation
insert
Word/Prefix
"apple"
Result
inserted
Stored words
(1)
apple
Operation
insert
Word/Prefix
"app"
Result
inserted
Stored words
(2)
apple
app
Operation
search
Word/Prefix
"apple"
Result
-
Looking for
apple
Stored words
(2)
apple
app
Operation
search
Word/Prefix
"app"
Result
-
Looking for
app
Stored words
(2)
apple
app
Operation
search
Word/Prefix
"app"
Result
-
Looking for
app
Stored words
(2)
apple
app
Operation
startsWith
Word/Prefix
"app"
Result
-
Looking for
app
Stored words
(2)
apple
app
Operation
startsWith
Word/Prefix
"app"
Result
true
Looking for
app
Stored words
(2)
apple
app
Operation
startsWith
Word/Prefix
"ap"
Result
-
Looking for
ap
Stored words
(2)
apple
app
Operation
startsWith
Word/Prefix
"ap"
Result
true
Stored words
(2)
apple
app
algo
master
.
io
Step:
Initialize an empty list of words
0 / 18
Input
Standard
Multiple Words
Not Found
Custom
operations
=
[Trie, insert, insert, search, search, startsWith, startsWith]
,
values
=
[null, apple, app, apple, app, app, ap]
0 / 18
algo
master
.
io
Step:
Initialize an empty list of words