tree

package
v0.0.0-...-f550c6f Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CBTInserter

type CBTInserter struct {
	Level     int
	LevelNums [][]*TreeNode
}

919. 完全二叉树插入器

func Constructor

func Constructor(root *TreeNode) CBTInserter

func (*CBTInserter) Get_root

func (this *CBTInserter) Get_root() *TreeNode

func (*CBTInserter) Insert

func (this *CBTInserter) Insert(val int) int

type Node

type Node struct {
	Val   int
	Left  *Node
	Right *Node
	Next  *Node
}

type TreeNode

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

* 二叉树的所有问题,就是让你在前中后序位置注入巧妙的代码逻辑,去达到自己的目的,你只需要单独思考每一个节点应该做什么,其它的都不用管,抛给二叉树遍历框架,递归会在所有节点上做相同的操作。

Jump to

Keyboard shortcuts

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