Depth-First Traversal Order

Graphs ยท easy

Given an adjacency list `adj` and a `start` node, implement `dfs(adj, start)` returning the order nodes are visited by depth-first search, visiting neighbors in listed order.

Learning resources

Loading...

Run your code to see results.