프로그래머스 & LeetCode DFS·BFS 문제 모음

프로그래머스와 LeetCode 깊이 우선 탐색(DFS)과 너비 우선 탐색(BFS) 문제를 찾아보세요. 그래프·격자 탐색 문제를 난이도별로 비교하고 기록합니다.

124개 문제 중 91–120

문제명난이도완료자정답률
Number of Good Leaf Nodes Pairs
트리DFS
Lv.3165,13272%
Detect Cycles in 2D Grid
DFS
Lv.3151,03064%
Even Odd Tree
트리BFS
Lv.2202,33967%
Map of Highest Peak
BFS
Lv.3173,85776%
Count Sub Islands
DFS
Lv.3230,65073%
Nearest Exit from Entrance in Maze
BFS
Lv.3309,29749%
Find All Groups of Farmland
DFS
Lv.2145,72976%
Step-By-Step Directions From a Binary Tree Node to Another
트리DFS
Lv.3247,76156%
Detonate the Maximum Bombs
그래프DFS
Lv.3192,25751%
All Ancestors of a Node in a Directed Acyclic Graph
그래프DFS
Lv.3167,98662%
Count Nodes Equal to Average of Subtree
트리DFS
Lv.2325,28189%
Count Unreachable Pairs of Nodes in an Undirected Graph
그래프DFS
Lv.3129,06850%
Evaluate Boolean Binary Tree
트리DFS
Lv.2234,22382%
Find Closest Node to Given Two Nodes
그래프DFS
Lv.3173,84653%
Reachable Nodes With Restrictions
트리DFS
Lv.294,38961%
Amount of Time for Binary Tree to Be Infected
트리BFS
Lv.3227,85366%
Reverse Odd Levels of Binary Tree
트리BFS
Lv.2198,32287%
Minimum Number of Operations to Sort a Binary Tree by Level
BFS트리정렬
Lv.3118,61874%
Closest Nodes Queries in a Binary Search Tree
이분 탐색트리DFS
Lv.242,93445%
Minimum Score of a Path Between Two Cities
그래프BFS
Lv.3210,68566%
Kth Largest Sum in a Binary Tree
BFS트리정렬
Lv.2190,50459%
Cousins in Binary Tree II
트리BFS
Lv.3133,74776%
Maximum Number of Fish in a Grid
DFS
Lv.2170,06070%
Count the Number of Complete Components
그래프DFS
Lv.3258,76181%
Find the Safest Path in a Grid
BFS이분 탐색
Lv.4209,88757%
Shortest Distance After Road Addition Queries I
BFS그래프
Lv.2119,26462%
Count the Number of Good Nodes
트리DFS
Lv.232,68155%
Find a Safe Walk Through a Grid
BFS
Lv.3139,66955%
Remove Methods From Project
그래프DFS
Lv.3136,77470%
Properties Graph
그래프DFS해시
Lv.227,76749%

문제는 프로그래머스나 LeetCode에서 풀고, 완료는 PS Guide에 직접 기록해야 합니다. 채점 결과는 자동으로 연동되지 않습니다.

LeetCode 문제의 Lv.은 PS Guide가 정한 값으로, SQL은 Easy·Medium·Hard를, 알고리즘은 대회 체감 난이도 점수를 기준으로 했습니다. 알고리즘 태그는 PS Guide의 분류이며 한 문제에 여러 풀이 방법이 있을 수 있습니다.

DFS / BFS 연습 길잡이

DFS 또는 BFS로 분류한 문제를 함께 모았습니다. 방문 처리가 필요한 상태를 정하고, 연결 영역 탐색인지 이동 횟수 탐색인지 살펴보세요. 가중치가 같은 이동에서 최단 거리를 찾을 때는 BFS를 연습할 수 있습니다.

Lv.13문제Lv.253문제Lv.353문제Lv.411문제Lv.54문제

정답률 중앙값 61%목록 전체 기준 · 개인의 체감 난이도와는 다를 수 있습니다.