All Posts

1276 articles

dsa2 min read

Clone Graph — BFS/DFS with HashMap

Deep copy an undirected graph. BFS/DFS with a HashMap from original node to cloned node prevents revisiting and handles cycles.

Read →
Page 47 of 256