[LeetCode] questions conclustion_BFS, DFS

时间:2023-03-08 21:53:55

BFS, DFS 的题目总结.

Directed graph:

Directed Graph Loop detection and if not have, path to print all path.

BFS/DFS: (可以用BFS或者DFS的,主要还是遍历)

[LeetCode] 733. Flood Fill_Easy tag: BFS     1

[LeetCode] 690. Employee Importance_Easy tag: BFS    1

[LeetCode] 529. Minesweeper_ Medium_ tag: BFS

[LeetCode] 200. Number of Islands_ Medium tag: BFS

[LeetCode] 133. Clone Graph_ Medium tag: BFS, DFS

[LeetCode] 261. Graph Valid Tree _ Medium tag: BFS

[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] 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] 116&117. Populating Next Right Pointers in Each Node I&II_Medium tag: BFS(Dont know why leetcode tag it as DFS...)

[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] 113. Path Sum II

[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