Breadth-First Search | LeetCode Problems

142 Breadth-First Search solutions to LeetCode solutions.

Breadth-First Search Problems View all solutions →

Same Tree

#100 Easy

Symmetric Tree

#101 Easy

Binary Tree Level Order Traversal

#102 Medium

Binary Tree Zigzag Level Order Traversal

#103 Medium

Maximum Depth of Binary Tree

#104 Easy

Binary Tree Level Order Traversal II

#107 Medium

Minimum Depth of Binary Tree

#111 Easy

Path Sum

#112 Easy

Populating Next Right Pointers in Each Node

#116 Medium

Populating Next Right Pointers in Each Node II

#117 Medium

Word Ladder II

#126 Hard

Word Ladder

#127 Hard

Surrounded Regions

#130 Medium

Clone Graph

#133 Medium

Binary Tree Right Side View

#199 Medium

Number of Islands

#200 Medium

Course Schedule

#207 Medium

Course Schedule II

#210 Medium

Invert Binary Tree

#226 Easy

Perfect Squares

#279 Medium

Serialize and Deserialize Binary Tree

#297 Hard

Remove Invalid Parentheses

#301 Hard

Minimum Height Trees

#310 Medium

Coin Change

#322 Medium

Longest Increasing Path in a Matrix

#329 Hard

Water and Jug Problem

#365 Medium

Evaluate Division

#399 Medium

Sum of Left Leaves

#404 Easy

Trapping Rain Water II

#407 Hard

Pacific Atlantic Water Flow

#417 Medium

N-ary Tree Level Order Traversal

#429 Medium

Minimum Genetic Mutation

#433 Medium

Serialize and Deserialize BST

#449 Medium

Island Perimeter

#463 Medium

Zuma Game

#488 Hard

Find Bottom Left Tree Value

#513 Medium

Freedom Trail

#514 Hard

Find Largest Value in Each Tree Row

#515 Medium

Minesweeper

#529 Medium

Minimum Absolute Difference in BST

#530 Easy

01 Matrix

#542 Medium

Number of Provinces

#547 Medium

Maximum Depth of N-ary Tree

#559 Easy

Merge Two Binary Trees

#617 Easy

Add One Row to Tree

#623 Medium

Average of Levels in Binary Tree

#637 Easy

Two Sum IV - Input is a BST

#653 Easy

Print Binary Tree

#655 Medium

Maximum Width of Binary Tree

#662 Medium

Bulb Switcher II

#672 Medium

Cut Off Trees for Golf Event

#675 Hard

Redundant Connection

#684 Medium

Redundant Connection II

#685 Hard

Employee Importance

#690 Medium

Max Area of Island

#695 Medium

Accounts Merge

#721 Medium

Flood Fill

#733 Easy

Network Delay Time

#743 Medium

Contain Virus

#749 Hard

Open the Lock

#752 Medium

Pyramid Transition Matrix

#756 Medium

Couples Holding Hands

#765 Hard

Sliding Puzzle

#773 Hard

Swim in Rising Water

#778 Hard

Minimum Distance Between BST Nodes

#783 Easy

Is Graph Bipartite?

#785 Medium

Cheapest Flights Within K Stops

#787 Medium

All Paths From Source to Target

#797 Medium

Find Eventual Safe States

#802 Medium

Bus Routes

#815 Hard

Making A Large Island

#827 Hard

Similar String Groups

#839 Hard

Keys and Rooms

#841 Medium

Shortest Path Visiting All Nodes

#847 Hard

K-Similar Strings

#854 Hard

All Nodes Distance K in Binary Tree

#863 Medium

Shortest Path to Get All Keys

#864 Hard

Smallest Subtree with all the Deepest Nodes

#865 Medium

Possible Bipartition

#886 Medium

Snakes and Ladders

#909 Medium

Complete Binary Tree Inserter

#919 Medium

Minimize Malware Spread

#924 Hard

Minimize Malware Spread II

#928 Hard

Shortest Bridge

#934 Medium

Check Completeness of a Binary Tree

#958 Medium

Regions Cut By Slashes

#959 Medium

Univalued Binary Tree

#965 Easy

Numbers With Same Consecutive Differences

#967 Medium

Vertical Order Traversal of a Binary Tree

#987 Hard

Cousins in Binary Tree

#993 Easy

Rotting Oranges

#994 Medium

Number of Enclaves

#1020 Medium

Coloring A Border

#1034 Medium

Escape a Large Maze

#1036 Hard

Flower Planting With No Adjacent

#1042 Medium

Shortest Path in Binary Matrix

#1091 Medium

Brace Expansion II

#1096 Hard

Lowest Common Ancestor of Deepest Leaves

#1123 Medium

Shortest Path with Alternating Colors

#1129 Medium

Maximum Level Sum of a Binary Tree

#1161 Medium

As Far from Land as Possible

#1162 Medium

Smallest String With Swaps

#1202 Medium

Sort Items by Groups Respecting Dependencies

#1203 Hard

Minimum Moves to Reach Target with Rotations

#1210 Hard

Number of Closed Islands

#1254 Medium

Find Elements in a Contaminated Binary Tree

#1261 Medium

Minimum Moves to Move a Box to Their Target Location

#1263 Hard

Count Servers that Communicate

#1267 Medium

Minimum Number of Flips to Convert Binary Matrix to Zero Matrix

#1284 Hard

Shortest Path in a Grid with Obstacles Elimination

#1293 Hard

Maximum Candies You Can Get from Boxes

#1298 Hard

Deepest Leaves Sum

#1302 Medium

Jump Game III

#1306 Medium

Get Watched Videos by Your Friends

#1311 Medium

Sum of Nodes with Even-Valued Grandparent

#1315 Medium

Number of Operations to Make Network Connected

#1319 Medium

Jump Game IV

#1345 Hard

Validate Binary Tree Nodes

#1361 Medium

Minimum Cost to Make at Least One Valid Path in a Grid

#1368 Hard

Time Needed to Inform All Employees

#1376 Medium

Frog Position After T Seconds

#1377 Hard

Find a Corresponding Node of a Binary Tree in a Clone of That Tree

#1379 Easy

Check if There is a Valid Path in a Grid

#1391 Medium

Minimum Time to Collect All Apples in a Tree

#1443 Medium

Count Good Nodes in Binary Tree

#1448 Medium

Pseudo-Palindromic Paths in a Binary Tree

#1457 Medium

Course Schedule IV

#1462 Medium

Reorder Routes to Make All Paths Lead to the City Zero

#1466 Medium

Kth Ancestor of a Tree Node

#1483 Hard

Number of Nodes in the Sub-Tree With the Same Label

#1519 Medium

Detect Cycles in 2D Grid

#1559 Medium

Minimum Number of Days to Disconnect Island

#1568 Hard

Even Odd Tree

#1609 Medium

Lexicographically Smallest String After Applying Operations

#1625 Medium

Path With Minimum Effort

#1631 Medium

Map of Highest Peak

#1765 Medium

Nearest Exit from Entrance in Maze

#1926 Medium

Most Profitable Path in a Tree

#2467 Medium

Divide Nodes Into the Maximum Number of Groups

#2493 Hard

Maximum Number of Points From Grid Queries

#2503 Hard

Maximum Number of Fish in a Grid

#2658 Medium

Count the Number of Complete Components

#2685 Medium