码迷,mamicode.com
首页 > 其他好文 > 详细

111.minimum depth of binary tree(E)

时间:2018-11-03 18:17:11      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:tree   find   nbsp   minimum   span   down   test   null   number   

111. minimum depth of binary tree

 

111. minimum 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: A leaf is a node with no children.

Example:

Given binary tree [3,9,20,null,null,15,7],

    3
   /   9  20
    /     15   7
return its minimum depth = 2.

 

111.minimum depth of binary tree(E)

标签:tree   find   nbsp   minimum   span   down   test   null   number   

原文地址:https://www.cnblogs.com/guxuanqing/p/9901469.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!