Skip to main content
SWStudyWalks Search

Computer Science / Unit 3   CS 0150 short lesson, about 20 seconds

Depth-First Search

Captions available

The idea

Depth-first search traverses a graph by recursively exploring each neighbor as far as each path allows, an explored set preventing revisits — cost in O(V plus E).

In practice

A maze walked by always pushing forward and backtracking at dead ends is depth-first embodied.

Where people slip

The explored set is what stops the wandering forever.

Your place on the trail

Every lesson rests on earlier ones and opens later ones. Tap any to jump.

Unlocks

  • Nothing yet depends on this.

Something wrong in this lesson? Flag it  ·  Sources for Computer Science