Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Clone Graph
Bookmark
Input
Square (4 nodes)
Two nodes
Triangle (3 nodes)
Hexagon (6 nodes)
Custom
adjList
=
[[2,4],[1,3],[2,4],[1,3]]
Original Graph
1
2
3
4
Cloned Graph
Call Stack
(empty)
Visited (HashMap):
{} (empty)
Legend:
Standard
Visiting
Cloned/Active
Visited
algo
master
.
io
Step:
Start cloning graph with 4 nodes using DFS
0 / 43
Input
Square (4 nodes)
Two nodes
Triangle (3 nodes)
Hexagon (6 nodes)
Custom
adjList
=
[[2,4],[1,3],[2,4],[1,3]]
0 / 43
Original Graph
1
2
3
4
Cloned Graph
Call Stack
(empty)
Visited (HashMap):
{} (empty)
Legend:
Standard
Visiting
Cloned/Active
Visited
algo
master
.
io
Step:
Start cloning graph with 4 nodes using DFS