Open
Description
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
- 144. Binary Tree Preorder Traversal
- 94. Binary Tree Inorder Traversal
- 145. Binary Tree Postorder Traversal
- 104. Maximum Depth of Binary Tree
- 112. Path Sum
- 113. Path Sum II
- 124. Binary Tree Maximum Path Sum
- 236. Lowest Common Ancestor of a Binary Tree
Graph DFS Problems
- 200. Number of Islands
- 130. Surrounded Regions
- 797. All Paths From Source to Target
- 733. Flood Fill
- 695. Max Area of Island
- 417. Pacific Atlantic Water Flow
- 547. Number of Provinces
- 785. Is Graph Bipartite?
Backtracking DFS Problems
- 46. Permutations
- 78. Subsets
- 39. Combination Sum
- 77. Combinations
- 51. N-Queens
- 52. N-Queens II
- 212. Word Search II
- 22. Generate Parentheses
Advanced DFS and Path-Finding Problems
- 329. Longest Increasing Path in a Matrix
- 1245. Tree Diameter
- 399. Evaluate Division
- 684. Redundant Connection
- 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
Labels
No labels