Search⌘ K
AI Features

Challenge: Implement Depth-First Search

Explore how to implement depth-first search on directed graphs represented by adjacency lists. Learn to traverse graph nodes starting from a source vertex and return the DFS order. This lesson helps you understand graph traversal algorithms and practice coding DFS in Python.

We'll cover the following...

Statement

Given a directed graph represented by an adjacency list graph and an integer source, representing the start vertex of the graph, return an array of integers, result that shows the order of depth-first traversal starting from the specified source vertex.

Constraints

  • 11 ...