collections

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stack

type Stack[T any] struct {
	Items []T
}

func (Stack[T]) IsEmpty

func (s Stack[T]) IsEmpty() bool

func (*Stack[T]) Pop

func (s *Stack[T]) Pop() *T

func (*Stack[T]) Push

func (s *Stack[T]) Push(item T)

func (*Stack[T]) Top

func (s *Stack[T]) Top() *T

type Tree

type Tree[T any] struct {
	// contains filtered or unexported fields
}

func CopyTree

func CopyTree[T TreeProvider[T]](root T) Tree[T]

func NewTree

func NewTree[T any](node T, children []TreeProvider[T]) Tree[T]

func (*Tree[T]) Children

func (t *Tree[T]) Children() iter.Seq[TreeProvider[T]]

func (*Tree[T]) Node

func (t *Tree[T]) Node() T

func (*Tree[T]) SetChildren

func (t *Tree[T]) SetChildren(children []TreeProvider[T])

type TreeProvider

type TreeProvider[T any] interface {
	Node() T
	Children() iter.Seq[TreeProvider[T]]
}

Jump to

Keyboard shortcuts

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