Data Structures and Algorithms

Depth-First Search

executive summary

A depth-first traversal is akin to navigating a maze.

We pursue neighbors of neighbors of neighbors for as long as we can make new discoveries, backtrack when we are stuck, and stop when we are truly stuck (i.e, nothing new to discover and nowhere to backtrack).

link to companion notes · Jeff Erickson Book Chapter · visualgo

In these slides we cover a stack-based implementation of DFS.

Data Structures and Algorithms Depth-First Search executive summary A depth-first traversal is akin to navigating a maze. We pursue neighbors of neighbors of neighbors for as long as we can make new discoveries, backtrack when we are stuck, and stop when we are truly stuck (i.e, nothing new to discover and nowhere to backtrack). link to companion notes · Jeff Erickson Book Chapter · visualgo In these slides we cover a stack-based implementation of DFS.

DSA · Depth-First Search

By Neeldhara Misra

DSA · Depth-First Search

  • 530