题目描述
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.
解题
思路
二叉树层次遍历的变种,使用层次遍历解决即可
代码
|
酷爱历史文学的程序猿
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.
二叉树层次遍历的变种,使用层次遍历解决即可
|
微信打赏
支付宝打赏
热评文章