tree

package
v0.0.0-...-f9738e6 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildArrayTree

func BuildArrayTree[T Tree[T]](array []T) []T

func BuildTree

func BuildTree[T Tree[T]](array []T) T

func BuildTreeByID

func BuildTreeByID[T Tree[T]](array []T, id uint32) T

func FindRootSet

func FindRootSet[T Tree[T]](array []T) map[uint32]bool

func FindRoots

func FindRoots[T Tree[T]](array []T) []uint32

func GetTreeID

func GetTreeID[T Tree[T]](tree T) []uint32

Types

type Tree

type Tree[T any] interface {
	ID() uint32
	Parent() uint32
	AppendChildren(T)
	ChildrenNode() []T
}

Jump to

Keyboard shortcuts

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