Data Structures & Algorithms

Depth-First Search

/depθ fɜːst sɜːtʃ/

Definition

A graph traversal following edges as deep as possible before backtracking — uses a stack or recursion.

Example in context

"DFS is used to detect cycles in a dependency graph — if you revisit a node on the current path, there's a cycle."

Related terms

Practice this term

Master Depth-First Search in context by working through exercises in the Data Structures & Algorithms module. You'll see the term used in real engineering scenarios with multiple-choice, fill-in-the-blank, and matching drills.

Frequently Asked Questions

What does "Depth-First Search" mean?

A graph traversal following edges as deep as possible before backtracking — uses a stack or recursion.

How do you pronounce "Depth-First Search"?

"Depth-First Search" is pronounced /depθ fɜːst sɜːtʃ/.

Can you use "Depth-First Search" in a sentence?

"DFS is used to detect cycles in a dependency graph — if you revisit a node on the current path, there's a cycle."