Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Word Ladder
Bookmark
Input
Example 1: hit -> cog
Example 2: lost -> cost
Simple: a -> c
Custom
beginWord
=
hit
,
endWord
=
cog
,
wordList
=
[hot, dot, dog, lot, log, cog]
queue
algo
master
.
io
Step:
Start: Find shortest transformation sequence using BFS
Variable
Value
beginWord
"hit"
endWord
"cog"
wordList
Array(6) ["hot", "dot", "dog"...]
dict_set
-
queue
-
visited
-
steps
-
Variable
Value
level_size
-
i
-
current
-
j
-
c
-
neighbor
-
0 / 24
Input
Example 1: hit -> cog
Example 2: lost -> cost
Simple: a -> c
Custom
beginWord
=
hit
,
endWord
=
cog
,
wordList
=
[hot, dot, dog, lot, log, cog]
0 / 24
queue
algo
master
.
io
Step:
Start: Find shortest transformation sequence using BFS
Visualization
Variables