मुख्य कंटेंट तक स्किप करें

15 docs tagged with "dfs"

सारे टैग देखें

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.

Find Eventual Safe States

Solution for LeetCode 802: Find Eventual Safe States, utilizing Graph Traversal (DFS Cycle Detection) and BFS (Kahn's Algorithm).

Flood Fill

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

Number of Islands

Solution for LeetCode 200: Number of Islands, utilizing Graph Traversal (DFS) to count connected components in a matrix.

Number of Provinces

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

Surrounded Regions

Solution for LeetCode 130: Surrounded Regions, utilizing Graph Traversal (DFS) on the boundaries to capture enclosed components.

Tarjan's Algorithm

A complete guide to Tarjan's Algorithm for Strongly Connected Components (SCCs) with explanations, use cases, and implementations in Python, Java, C++, and JavaScript.

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).