binary_tree

package
v0.0.0-...-ac1e4b7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InorderTraversal

func InorderTraversal(root *TreeNode) []int

func MaxDepth

func MaxDepth(root *TreeNode) int

MaxDepth 递归计算左右子树的高度,然后+1

Types

type TreeNode

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

func InvertTree

func InvertTree(root *TreeNode) *TreeNode

InvertTree 递归反转左右子树

Jump to

Keyboard shortcuts

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