Search⌘ K
AI Features

Solution: Minimum Depth of Binary Tree

C# solution for the Minimum Depth of Binary Tree problem using the Tree Breadth-First Search pattern.

Statement

Given the root of a binary tree, return the minimum depth of the tree.

The minimum depth is the number of nodes along the shortest path from root down to the nearest leaf node. A leaf node is a node that has no children.

Note: A leaf node is defined as a node with neither a left child nor a right child.

Constraints:

  • The number of nodes in the tree is in the range ...