lc515

package
v0.0.0-...-b071cee Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

README

515.在每个树行中找最大值

1. 题目描述

给定一棵二叉树的根节点 root ,请找出该二叉树中每一层的最大值。

示例1:


输入: root = [1,3,2,5,3,null,9]
输出: [1,3,9]

示例2:


输入: root = [1,2,3]
输出: [1,3]

提示:

  • 二叉树的节点个数的范围是 [0,10^4]
  • -2^31 <= Node.val <= 2^31 - 1

标签 深度优先搜索 广度优先搜索 二叉树

2. 解题

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