tree

package
v0.0.0-...-c5d7d13 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dfs

func Dfs(node *TreeNode, l int, r int) int

Dfs is an algorithm for traversing or searching tree or graph data structures.

Types

type TreeNode

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

func Bfs

func Bfs(nodes []*TreeNode) ([]int, []*TreeNode)

Bfs Breadth-First Search

func (*TreeNode) Add

func (t *TreeNode) Add(arr []int, i int) int

func (*TreeNode) Diagram

func (t *TreeNode) Diagram(top string, root string, bottom string) string

func (*TreeNode) List

func (t *TreeNode) List() []int

func (*TreeNode) Size

func (t *TreeNode) Size() int

Jump to

Keyboard shortcuts

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