Breadth-First Search Problems
197 Breadth-First Search LeetCode problems · Solve with AI-powered hints & step-by-step explanations.
Learn the coding interview patterns behind these problems, including Breadth-First Search interview patterns.
Start with these
100 Same Tree Easy102 Binary Tree Level Order Traversal Medium104 Maximum Depth of Binary Tree Easy133 Clone Graph Medium200 Number of Islands Medium207 Course Schedule Medium210 Course Schedule II Medium226 Invert Binary Tree Easy297 Serialize and Deserialize Binary Tree Hard322 Coin Change Medium417 Pacific Atlantic Water Flow Medium749 Contain Virus Hard994 Rotting Oranges Medium
All Breadth-First Search problems
100 Same Tree Easy101 Symmetric Tree Easy102 Binary Tree Level Order Traversal Medium103 Binary Tree Zigzag Level Order Traversal Medium104 Maximum Depth of Binary Tree Easy107 Binary Tree Level Order Traversal II Medium111 Minimum Depth of Binary Tree Easy112 Path Sum Easy116 Populating Next Right Pointers in Each Node Medium117 Populating Next Right Pointers in Each Node II Medium126 Word Ladder II Hard127 Word Ladder Hard130 Surrounded Regions Medium133 Clone Graph Medium199 Binary Tree Right Side View Medium200 Number of Islands Medium207 Course Schedule Medium210 Course Schedule II Medium226 Invert Binary Tree Easy279 Perfect Squares Medium297 Serialize and Deserialize Binary Tree Hard301 Remove Invalid Parentheses Hard310 Minimum Height Trees Medium322 Coin Change Medium329 Longest Increasing Path in a Matrix Hard365 Water and Jug Problem Medium399 Evaluate Division Medium404 Sum of Left Leaves Easy407 Trapping Rain Water II Hard417 Pacific Atlantic Water Flow Medium429 N-ary Tree Level Order Traversal Medium433 Minimum Genetic Mutation Medium449 Serialize and Deserialize BST Medium463 Island Perimeter Easy488 Zuma Game Hard513 Find Bottom Left Tree Value Medium514 Freedom Trail Hard515 Find Largest Value in Each Tree Row Medium529 Minesweeper Medium530 Minimum Absolute Difference in BST Easy542 01 Matrix Medium547 Number of Provinces Medium559 Maximum Depth of N-ary Tree Easy617 Merge Two Binary Trees Easy623 Add One Row to Tree Medium637 Average of Levels in Binary Tree Easy653 Two Sum IV - Input is a BST Easy655 Print Binary Tree Medium662 Maximum Width of Binary Tree Medium672 Bulb Switcher II Medium675 Cut Off Trees for Golf Event Hard684 Redundant Connection Medium685 Redundant Connection II Hard690 Employee Importance Medium695 Max Area of Island Medium721 Accounts Merge Medium733 Flood Fill Easy743 Network Delay Time Medium749 Contain Virus Hard752 Open the Lock Medium756 Pyramid Transition Matrix Medium765 Couples Holding Hands Hard773 Sliding Puzzle Hard778 Swim in Rising Water Hard783 Minimum Distance Between BST Nodes Easy785 Is Graph Bipartite? Medium787 Cheapest Flights Within K Stops Medium797 All Paths From Source to Target Medium802 Find Eventual Safe States Medium815 Bus Routes Hard827 Making A Large Island Hard839 Similar String Groups Hard841 Keys and Rooms Medium847 Shortest Path Visiting All Nodes Hard854 K-Similar Strings Hard863 All Nodes Distance K in Binary Tree Medium864 Shortest Path to Get All Keys Hard865 Smallest Subtree with all the Deepest Nodes Medium886 Possible Bipartition Medium909 Snakes and Ladders Medium919 Complete Binary Tree Inserter Medium924 Minimize Malware Spread Hard928 Minimize Malware Spread II Hard934 Shortest Bridge Medium958 Check Completeness of a Binary Tree Medium959 Regions Cut By Slashes Medium965 Univalued Binary Tree Easy967 Numbers With Same Consecutive Differences Medium987 Vertical Order Traversal of a Binary Tree Hard993 Cousins in Binary Tree Easy994 Rotting Oranges Medium1020 Number of Enclaves Medium1034 Coloring A Border Medium1036 Escape a Large Maze Hard1042 Flower Planting With No Adjacent Medium1091 Shortest Path in Binary Matrix Medium1096 Brace Expansion II Hard1123 Lowest Common Ancestor of Deepest Leaves Medium1129 Shortest Path with Alternating Colors Medium1161 Maximum Level Sum of a Binary Tree Medium1162 As Far from Land as Possible Medium1202 Smallest String With Swaps Medium1203 Sort Items by Groups Respecting Dependencies Hard1210 Minimum Moves to Reach Target with Rotations Hard1254 Number of Closed Islands Medium1261 Find Elements in a Contaminated Binary Tree Medium1263 Minimum Moves to Move a Box to Their Target Location Hard1267 Count Servers that Communicate Medium1284 Minimum Number of Flips to Convert Binary Matrix to Zero Matrix Hard1293 Shortest Path in a Grid with Obstacles Elimination Hard1298 Maximum Candies You Can Get from Boxes Hard1302 Deepest Leaves Sum Medium1306 Jump Game III Medium1311 Get Watched Videos by Your Friends Medium1315 Sum of Nodes with Even-Valued Grandparent Medium1319 Number of Operations to Make Network Connected Medium1345 Jump Game IV Hard1361 Validate Binary Tree Nodes Medium1368 Minimum Cost to Make at Least One Valid Path in a Grid Hard1376 Time Needed to Inform All Employees Medium1377 Frog Position After T Seconds Hard1379 Find a Corresponding Node of a Binary Tree in a Clone of That Tree Easy1391 Check if There is a Valid Path in a Grid Medium1443 Minimum Time to Collect All Apples in a Tree Medium1448 Count Good Nodes in Binary Tree Medium1457 Pseudo-Palindromic Paths in a Binary Tree Medium1462 Course Schedule IV Medium1466 Reorder Routes to Make All Paths Lead to the City Zero Medium1483 Kth Ancestor of a Tree Node Hard1519 Number of Nodes in the Sub-Tree With the Same Label Medium1559 Detect Cycles in 2D Grid Medium1568 Minimum Number of Days to Disconnect Island Hard1609 Even Odd Tree Medium1625 Lexicographically Smallest String After Applying Operations Medium1631 Path With Minimum Effort Medium1654 Minimum Jumps to Reach Home Medium1765 Map of Highest Peak Medium1905 Count Sub Islands Medium1926 Nearest Exit from Entrance in Maze Medium1970 Last Day Where You Can Still Cross Hard1971 Find if Path Exists in Graph Easy1992 Find All Groups of Farmland Medium1993 Operations on Tree Medium2039 The Time When the Network Becomes Idle Medium2045 Second Minimum Time to Reach Destination Hard2059 Minimum Operations to Convert Number Medium2092 Find All People With Secret Hard2101 Detonate the Maximum Bombs Medium2146 K Highest Ranked Items Within a Price Range Medium2192 All Ancestors of a Node in a Directed Acyclic Graph Medium2258 Escape the Spreading Fire Hard2290 Minimum Obstacle Removal to Reach Corner Hard2316 Count Unreachable Pairs of Nodes in an Undirected Graph Medium2328 Number of Increasing Paths in a Grid Hard2360 Longest Cycle in a Graph Hard2368 Reachable Nodes With Restrictions Medium2385 Amount of Time for Binary Tree to Be Infected Medium2415 Reverse Odd Levels of Binary Tree Medium2458 Height of Binary Tree After Subtree Removal Queries Hard2467 Most Profitable Path in a Tree Medium2471 Minimum Number of Operations to Sort a Binary Tree by Level Medium2477 Minimum Fuel Cost to Report to the Capital Medium2492 Minimum Score of a Path Between Two Cities Medium2493 Divide Nodes Into the Maximum Number of Groups Hard2503 Maximum Number of Points From Grid Queries Hard2556 Disconnect Path in a Binary Matrix by at Most One Flip Medium2577 Minimum Time to Visit a Cell In a Grid Hard2583 Kth Largest Sum in a Binary Tree Medium2596 Check Knight Tour Configuration Medium2608 Shortest Cycle in a Graph Hard2612 Minimum Reverse Operations Hard2617 Minimum Number of Visited Cells in a Grid Hard2641 Cousins in Binary Tree II Medium2658 Maximum Number of Fish in a Grid Medium2685 Count the Number of Complete Components Medium2812 Find the Safest Path in a Grid Medium2850 Minimum Moves to Spread Stones Over Grid Medium2858 Minimum Edge Reversals So Every Node Is Reachable Hard2998 Minimum Number of Operations to Make X and Y Equal Medium3015 Count the Number of Houses at a Certain Distance I Medium3123 Find Edges in Shortest Paths Hard3203 Find Minimum Diameter After Merging Two Trees Hard3235 Check if the Rectangle Corner Is Reachable Hard3243 Shortest Distance After Road Addition Queries I Medium3283 Maximum Number of Moves to Kill All Pawns Hard3286 Find a Safe Walk Through a Grid Medium3310 Remove Methods From Project Medium3372 Maximize the Number of Target Nodes After Connecting Trees I Medium3373 Maximize the Number of Target Nodes After Connecting Trees II Hard3387 Maximize Amount After Two Days of Conversions Medium3419 Minimize the Maximum Edge Weight of Graph Medium3493 Properties Graph Medium3528 Unit Conversion I Medium3552 Grid Teleportation Traversal Medium3568 Minimum Moves to Clean the Classroom Medium3607 Power Grid Maintenance Medium3619 Count Islands With Total Value Divisible by K Medium