merge_two_binary_trees

package
v0.0.0-...-a70e5fa Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package merge_two_binary_trees https://leetcode-cn.com/problems/merge-two-binary-trees/

617. 合并二叉树

给定两个二叉树,想象当你将它们中的一个覆盖到另一个上时,两个二叉树的一些节点便会重叠。 你需要将他们合并为一个新的二叉树。合并的规则是如果两个节点重叠,那么将他们的值相加作为节点合并后的新值, 否则不为 NULL 的节点将直接作为新二叉树的节点。

注意:

合并必须从两个树的根节点开始。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TreeNode

type TreeNode struct {
	Val   int
	Left  *TreeNode
	Right *TreeNode
}

TreeNode Definition for a binary tree node.

Jump to

Keyboard shortcuts

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