list

package
v0.0.0-...-07010e4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type List

type List[T any] struct {
	First *Node[T]
	Last  *Node[T]
}

func New

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

func (*List[T]) Dump

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

func (*List[T]) Each

func (l *List[T]) Each(do func(T))

func (*List[T]) Find

func (l *List[T]) Find(start *Node[T], match func(T) bool) *Node[T]

func (*List[T]) InsertAfter

func (l *List[T]) InsertAfter(v T, an *Node[T]) *Node[T]

func (*List[T]) InsertBefore

func (l *List[T]) InsertBefore(v T, bn *Node[T]) *Node[T]

func (*List[T]) IsEmpty

func (l *List[T]) IsEmpty() bool

func (*List[T]) IsValid

func (l *List[T]) IsValid(tn *Node[T]) bool

func (*List[T]) PushBack

func (l *List[T]) PushBack(v T) *Node[T]

func (*List[T]) PushFront

func (l *List[T]) PushFront(v T) *Node[T]

func (*List[T]) Remove

func (l *List[T]) Remove(rn *Node[T])

func (*List[T]) Values

func (l *List[T]) Values() []T

type Node

type Node[T any] struct {
	Value T
	Prev  *Node[T]
	Next  *Node[T]
}

func (*Node[T]) Format

func (n *Node[T]) Format() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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