Data Structures & Algorithms using JavaScript Course
Data Structures & Algorithms using JavaScript
/
Intermediate

Depth First Search

Definition

An algorithm for traversing a graph by exploring as far as possible along each branch before backtracking. Requires a 'visited' Set to prevent infinite loops in cyclic graphs.

Explain Like I'm New

Driving down a highway until it completely dead-ends, then driving back to the last fork in the road to try the other path.

Interactive Coding Challenges

Number of Islands

Solution Code

Loading...
Console output will appear here...