Min Depth of Binary Tree

Given a binary tree, find its minimum depth.

The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.

NOTE : The path has to end on a leaf node.

Example :

         1
        /
       2

min depth = 2.

Interview Code Editor
Hints
  • Solution Approach
  • Complete Solution
4990 successful submissions.
Asked In:
  • Facebook
  • Amazon
Click here to jump start your coding interview preparation