🎉 October Learning Month — learn a new software term every day!
An interactive flashcard trainer for software engineering terms.

Depth First Search

In plain terms

Exploring a graph by going as deep as possible before backtracking.

Going deeper

DFS follows one path to its end, then backtracks to explore others, using a stack or recursion. It's natural for exhaustive exploration and detecting structure.

Under the hood

O(V+E) time; underlies cycle detection, topological sort, and connected-component finding.

Examples

Maze solving, topological sort, cycle detection, puzzle solving, tree traversal.

Think of it like...

Like exploring a maze by following each corridor to a dead end before backtracking.

Feedback & Bug Report