Skip to main content

11 docs tagged with "dfs"

View all tags

BFS vs DFS

A side-by-side comparison of Breadth-First Search (BFS) and Depth-First Search (DFS) graph traversal algorithms.

Depth-First Search (DFS)

A complete guide to Depth-First Search (DFS) algorithm with explanations, use cases, and implementations in Python, Java, C++, and JavaScript.

Depth-First Search (DFS) in Swift

Learn how to implement Depth-First Search (DFS) for graph traversal in Swift, with recursive and iterative code examples and complexity analysis.

Diameter of Binary Tree

Solving the Diameter of Binary Tree problem using a Recursive Depth-First Search (DFS) approach.

Flood Fill

Solution for LeetCode 733: Flood Fill, utilizing Graph Traversal (DFS).

Number of Provinces

Solution for LeetCode 547: Number of Provinces, utilizing Graph Traversal (DFS) to find connected components.

Word Search

Solve the Word Search problem using DFS with backtracking on a 2D character grid. Covers both Word Search I (single word) and Word Search II (multiple words with Trie).