internal

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Unlicense Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[K comparable, T any] interface {
	Put(key K, value T)
	Get(key K) (T, error)
}

type Heap

type Heap[T any] interface {
	Push(values ...T)
	Pop() (T, error)
	PushPop(value T) (T, error)
	Top() (T, error)
	IsEmpty() bool
}

type List

type List[T any] interface {
	Length() int
	Append(values ...T)
	Prepend(values ...T)
	Insert(value T, after int) error
	All() iter.Seq2[int, T]
	Backward() iter.Seq2[int, T]
	Search(target T, equal func(value, target T) bool) (int, error)
	Index(at int) (T, error)
	Pop() (T, error)
	Dequeue() (T, error)
	Remove(at int) (T, error)
}

type Node

type Node[T any] struct {
	Value T
	// Left node or previous node
	Left *Node[T]
	// Right node or next node
	Right *Node[T]
}

func (*Node[T]) Insert

func (n *Node[T]) Insert(newRight *Node[T])
func (n *Node[T]) Unlink()

type Queue

type Queue[T any] interface {
	Length() int
	Push(values ...T)
	Dequeue() (T, error)
	Front() (T, error)
	Rear() (T, error)
}

type Stack

type Stack[T any] interface {
	Length() int
	Push(values ...T)
	Pop() (T, error)
	Top() (T, error)
}

Jump to

Keyboard shortcuts

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