list

package
v0.0.0-...-c92c33a Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Linker

type Linker[T any] interface {
	// contains filtered or unexported methods
}

type List

type List[T any] struct {
	Head Node[T]
}

func New

func New[T any]() *List[T]

func (*List[T]) All

func (l *List[T]) All() iter.Seq[T]

func (*List[T]) Filter

func (l *List[T]) Filter(fn func(T) bool) iter.Seq[T]

func (*List[T]) Len

func (l *List[T]) Len() int

func (*List[T]) PushBack

func (l *List[T]) PushBack(data T)

func (*List[T]) PushFront

func (l *List[T]) PushFront(data T)

func (*List[T]) String

func (l *List[T]) String() string

type Node

type Node[T any] interface {
	Linker[T]
	// contains filtered or unexported methods
}

Node interface defines an interface for nodes in the linked list so we can iterate them easier.

Jump to

Keyboard shortcuts

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