BFS, DFS 的題目總結. html
Directed graph:node
Directed Graph Loop detection and if not have, path to print all path.ide
BFS/DFS: (能夠用BFS或者DFS的,主要仍是遍歷)oop
[LeetCode] 733. Flood Fill_Easy tag: BFS 1code
[LeetCode] 690. Employee Importance_Easy tag: BFS 1htm
[LeetCode] 529. Minesweeper_ Medium_ tag: BFSblog
[LeetCode] 200. Number of Islands_ Medium tag: BFSip
[LeetCode] 133. Clone Graph_ Medium tag: BFS, DFSleetcode
[LeetCode] 261. Graph Valid Tree _ Medium tag: BFSget
[LeetCode] 301. Remove Invalid Parentheses_Hard tag:BFS
[LeetCode] 104. Maximum Depth of Binary Tree_Easy tag: DFS
[LeetCode] 827. Making A Large Island
[LeetCode] 695. Max Area of Island_Easy tag: DFS/BFS
[LeetCode] 490. The Maze_Medium tag: BFS/DFS
[LeetCode] 130. Surrounded Regions_Medium tag: DFS
BFS(shortest path/distance, level traversal)
[Leetcode] 863. All Nodes Distance K in Binary Tree_ Medium tag: BFS, Amazon 1
[LeetCode] 199. Binary Tree Right Side View_ Medium tag: BFS, Amazon
[LeetCode] 102. Binary Tree Level Order Traversal_Medium tag: BFS
[LeetCode] 429. N-ary Tree Level Order Traversal_ Easy
[LeetCode] 127. Word Ladder _Medium tag: BFS
[LeetCode] 675. Cut Off Trees for Golf Event_Hard tag: BFS
[LeetCode] 103. Binary Tree Zigzag Level Order Traversal _ Medium tag: BFS
[LeetCode] 101. Symmetric Tree_ Easy tag: BFS
[LeetCode] 513. Find Bottom Left Tree Value_ Medium tag: BFS
[LeetCode] 286. Walls and Gates_Medium tag: BFS
[LeetCode] 310. Minimum Height Trees_Medium tag: BFS
DFS
[LeetCode] 207 Course Schedule_Medium tag: BFS, DFS 1
[LeetCode] 785. Is Graph Bipartite?_Medium tag: DFS, BFS
[LeetCode] 210. Course Schedule II
[LeetCode] 694. Number of Distinct Islands
[LeetCode] 711. Number of Distinct Islands II_hard tag: DFS
[LeetCode] 851. Loud and Rich_ Medium tag: DFS
[LeetCode] 112. Path Sum_Easy tag: DFS
[LeetCode] 114. Flatten Binary Tree to Linked List_Medium tag: DFS
[LeetCode] 257. Binary Tree Paths_ Easy tag: DFS
[LeetCode] 437. Path Sum III_ Easy tag: DFS
[LeetCode] 124. Binary Tree Maximum Path Sum_ Hard tag: DFS recursive
[LeetCode] 687. Longest Univalue Path_Easy tag: DFS recursive
[LeetCode] 298. Binary Tree Longest Consecutive Sequence_Medium tag: DFS recursive
[LeetCode] 549. Binary Tree Longest Consecutive Sequence II_ Medium tag: DFS recursive
[LeetCode] 721. Accounts Merge_Medium tag: DFS recursive
[LeetCode] 111. Minimum Depth of Binary Tree_Easy tag:DFS
[LeetCode] 110. Balanced Binary Tree_Easy tag: DFS
[LeetCode] 100. Same Tree_Easy tag: DFS
[LeetCode] 99. Recover Binary Search Tree
[LeetCode] 129. Sum Root to Leaf Numbers_Medium tag: DFS
[LeetCode] 559. Maximum Depth of N-ary Tree_Easy tag: DFS
[LeetCode] 98. Validate Binary Search Tree_Medium
[LeetCode] 173. Binary Search Tree Iterator_Medium_tag: Binary Search Tree
[LeetCode] 700. Search in a Binary Search Treer_Easy_tag: Binary Search Tree
[LeetCode] 701. Insert into a Binary Search Tree_Medium_tag: Binary Search Tree
BFS & DFS