minimumdepthofbinarytree

package
v0.0.0-...-2b489ef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 1 Imported by: 0

README

111. 二叉树的最小深度

给定一个二叉树,找出其最小深度。

最小深度是从根节点到最近叶子节点的最短路径上的节点数量。

说明:叶子节点是指没有子节点的节点。

示例1:

  3
 /  \
9    20
    /  \
   15   7
input: root = [3,9,20,null,null,15,7]
output: 2

示例2:

input: root = [2,null,3,null,4,null,5,null,6]
output: 5

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL