Skip to content

DFS problem  #8

Open
Open
@kevin373738

Description

@kevin373738

Certainly! Here’s a list of some popular DFS problems on LeetCode, covering various data structures and applications of DFS such as tree traversal, graph traversal, and backtracking:

Binary Tree DFS Problems

  1. 144. Binary Tree Preorder Traversal
  2. 94. Binary Tree Inorder Traversal
  3. 145. Binary Tree Postorder Traversal
  4. 104. Maximum Depth of Binary Tree
  5. 112. Path Sum
  6. 113. Path Sum II
  7. 124. Binary Tree Maximum Path Sum
  8. 236. Lowest Common Ancestor of a Binary Tree

Graph DFS Problems

  1. 200. Number of Islands
  2. 130. Surrounded Regions
  3. 797. All Paths From Source to Target
  4. 733. Flood Fill
  5. 695. Max Area of Island
  6. 417. Pacific Atlantic Water Flow
  7. 547. Number of Provinces
  8. 785. Is Graph Bipartite?

Backtracking DFS Problems

  1. 46. Permutations
  2. 78. Subsets
  3. 39. Combination Sum
  4. 77. Combinations
  5. 51. N-Queens
  6. 52. N-Queens II
  7. 212. Word Search II
  8. 22. Generate Parentheses

Advanced DFS and Path-Finding Problems

  1. 329. Longest Increasing Path in a Matrix
  2. 1245. Tree Diameter
  3. 399. Evaluate Division
  4. 684. Redundant Connection
  5. 1376. Time Needed to Inform All Employees

These problems showcase DFS’s versatility, from simple traversals and connectivity checks to more complex recursive backtracking challenges. Let me know if you’d like more information on any of these!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions