← back

Breadth-First Search

200 questions · 0 seen

All Breadth-First Search problems

Problems

100 Same Tree
101 Symmetric Tree
102 Binary Tree Level Order Traversal
103 Binary Tree Zigzag Level Order Traversal
104 Maximum Depth of Binary Tree
107 Binary Tree Level Order Traversal II
111 Minimum Depth of Binary Tree
112 Path Sum
116 Populating Next Right Pointers in Each Node
117 Populating Next Right Pointers in Each Node II
126 Word Ladder II
127 Word Ladder
130 Surrounded Regions
133 Clone Graph
199 Binary Tree Right Side View
200 Number of Islands
207 Course Schedule
210 Course Schedule II
226 Invert Binary Tree
279 Perfect Squares
297 Serialize and Deserialize Binary Tree
301 Remove Invalid Parentheses
310 Minimum Height Trees
322 Coin Change
329 Longest Increasing Path in a Matrix
365 Water and Jug Problem
399 Evaluate Division
404 Sum of Left Leaves
407 Trapping Rain Water II
417 Pacific Atlantic Water Flow
429 N-ary Tree Level Order Traversal
433 Minimum Genetic Mutation
449 Serialize and Deserialize BST
463 Island Perimeter
488 Zuma Game
513 Find Bottom Left Tree Value
514 Freedom Trail
515 Find Largest Value in Each Tree Row
529 Minesweeper
530 Minimum Absolute Difference in BST
542 01 Matrix
547 Number of Provinces
559 Maximum Depth of N-ary Tree
617 Merge Two Binary Trees
623 Add One Row to Tree
637 Average of Levels in Binary Tree
653 Two Sum IV - Input is a BST
655 Print Binary Tree
662 Maximum Width of Binary Tree
672 Bulb Switcher II
675 Cut Off Trees for Golf Event
684 Redundant Connection
685 Redundant Connection II
690 Employee Importance
695 Max Area of Island
721 Accounts Merge
733 Flood Fill
743 Network Delay Time
749 Contain Virus
752 Open the Lock
765 Couples Holding Hands
773 Sliding Puzzle
778 Swim in Rising Water
783 Minimum Distance Between BST Nodes
785 Is Graph Bipartite?
787 Cheapest Flights Within K Stops
797 All Paths From Source to Target
802 Find Eventual Safe States
815 Bus Routes
827 Making A Large Island
839 Similar String Groups
841 Keys and Rooms
847 Shortest Path Visiting All Nodes
854 K-Similar Strings
863 All Nodes Distance K in Binary Tree
864 Shortest Path to Get All Keys
865 Smallest Subtree with all the Deepest Nodes
886 Possible Bipartition
909 Snakes and Ladders
919 Complete Binary Tree Inserter
924 Minimize Malware Spread
928 Minimize Malware Spread II
934 Shortest Bridge
958 Check Completeness of a Binary Tree
959 Regions Cut By Slashes
965 Univalued Binary Tree
967 Numbers With Same Consecutive Differences
987 Vertical Order Traversal of a Binary Tree
993 Cousins in Binary Tree
994 Rotting Oranges
1020 Number of Enclaves
1034 Coloring A Border
1036 Escape a Large Maze
1042 Flower Planting With No Adjacent
1091 Shortest Path in Binary Matrix
1096 Brace Expansion II
1123 Lowest Common Ancestor of Deepest Leaves
1129 Shortest Path with Alternating Colors
1161 Maximum Level Sum of a Binary Tree
1162 As Far from Land as Possible
1202 Smallest String With Swaps
1203 Sort Items by Groups Respecting Dependencies
1210 Minimum Moves to Reach Target with Rotations
1254 Number of Closed Islands
1261 Find Elements in a Contaminated Binary Tree
1263 Minimum Moves to Move a Box to Their Target Location
1267 Count Servers that Communicate
1284 Minimum Number of Flips to Convert Binary Matrix to Zero Matrix
1293 Shortest Path in a Grid with Obstacles Elimination
1298 Maximum Candies You Can Get from Boxes
1302 Deepest Leaves Sum
1306 Jump Game III
1311 Get Watched Videos by Your Friends
1315 Sum of Nodes with Even-Valued Grandparent
1319 Number of Operations to Make Network Connected
1345 Jump Game IV
1361 Validate Binary Tree Nodes
1368 Minimum Cost to Make at Least One Valid Path in a Grid
1376 Time Needed to Inform All Employees
1377 Frog Position After T Seconds
1379 Find a Corresponding Node of a Binary Tree in a Clone of That Tree
1391 Check if There is a Valid Path in a Grid
1443 Minimum Time to Collect All Apples in a Tree
1448 Count Good Nodes in Binary Tree
1457 Pseudo-Palindromic Paths in a Binary Tree
1462 Course Schedule IV
1466 Reorder Routes to Make All Paths Lead to the City Zero
1483 Kth Ancestor of a Tree Node
1519 Number of Nodes in the Sub-Tree With the Same Label (PRO)
1559 Detect Cycles in 2D Grid
1568 Minimum Number of Days to Disconnect Island
1609 Even Odd Tree
1625 Lexicographically Smallest String After Applying Operations
1631 Path With Minimum Effort
1654 Minimum Jumps to Reach Home
1765 Map of Highest Peak
1905 Count Sub Islands
1926 Nearest Exit from Entrance in Maze
1970 Last Day Where You Can Still Cross (PRO)
1971 Find if Path Exists in Graph
1992 Find All Groups of Farmland (PRO)
1993 Operations on Tree
2039 The Time When the Network Becomes Idle
2045 Second Minimum Time to Reach Destination
2059 Minimum Operations to Convert Number
2092 Find All People With Secret
2101 Detonate the Maximum Bombs
2146 K Highest Ranked Items Within a Price Range
2192 All Ancestors of a Node in a Directed Acyclic Graph
2258 Escape the Spreading Fire
2290 Minimum Obstacle Removal to Reach Corner
2316 Count Unreachable Pairs of Nodes in an Undirected Graph
2328 Number of Increasing Paths in a Grid
2360 Longest Cycle in a Graph
2368 Reachable Nodes With Restrictions
2385 Amount of Time for Binary Tree to Be Infected
2415 Reverse Odd Levels of Binary Tree
2458 Height of Binary Tree After Subtree Removal Queries
2467 Most Profitable Path in a Tree
2471 Minimum Number of Operations to Sort a Binary Tree by Level
2477 Minimum Fuel Cost to Report to the Capital
2492 Minimum Score of a Path Between Two Cities
2493 Divide Nodes Into the Maximum Number of Groups
2503 Maximum Number of Points From Grid Queries
2556 Disconnect Path in a Binary Matrix by at Most One Flip
2577 Minimum Time to Visit a Cell In a Grid
2583 Kth Largest Sum in a Binary Tree
2596 Check Knight Tour Configuration
2608 Shortest Cycle in a Graph
2612 Minimum Reverse Operations
2617 Minimum Number of Visited Cells in a Grid
2641 Cousins in Binary Tree II
2658 Maximum Number of Fish in a Grid
2685 Count the Number of Complete Components
2812 Find the Safest Path in a Grid
2858 Minimum Edge Reversals So Every Node Is Reachable
2998 Minimum Number of Operations to Make X and Y Equal
3015 Count the Number of Houses at a Certain Distance I
3123 Find Edges in Shortest Paths
3203 Find Minimum Diameter After Merging Two Trees
3235 Check if the Rectangle Corner Is Reachable
3243 Shortest Distance After Road Addition Queries I
3283 Maximum Number of Moves to Kill All Pawns
3286 Find a Safe Walk Through a Grid
3310 Remove Methods From Project
3372 Maximize the Number of Target Nodes After Connecting Trees I
3373 Maximize the Number of Target Nodes After Connecting Trees II
3387 Maximize Amount After Two Days of Conversions
3419 Minimize the Maximum Edge Weight of Graph
3493 Properties Graph
3528 Unit Conversion I
3552 Grid Teleportation Traversal
3568 Minimum Moves to Clean the Classroom
3607 Power Grid Maintenance
3619 Count Islands With Total Value Divisible by K
3629 Minimum Jumps to Reach End via Prime Teleportation
3666 Minimum Operations to Equalize Binary String
3690 Split and Merge Array Transformation
3710 Maximum Partition Factor
3820 Pythagorean Distance Nodes in a Tree