collections

package
v0.0.0-...-38cfe7b Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection[T any] interface {
	HasElements() bool
	IsEmpty() bool
}

type DoublyLinkedNode

type DoublyLinkedNode[T interface{}] struct {
	Value      T
	Prev, Next *DoublyLinkedNode[T]
}

func NewDoublyLinkedNode

func NewDoublyLinkedNode[T interface{}](value T) *DoublyLinkedNode[T]

func (*DoublyLinkedNode[T]) InsertNext

func (n *DoublyLinkedNode[T]) InsertNext(node *DoublyLinkedNode[T])

func (*DoublyLinkedNode[T]) InsertPrev

func (n *DoublyLinkedNode[T]) InsertPrev(node *DoublyLinkedNode[T])

func (*DoublyLinkedNode[T]) String

func (n *DoublyLinkedNode[T]) String() string
func (n *DoublyLinkedNode[T]) Unlink()

type Set

type Set[T comparable] interface {
	fmt.Stringer
	Size() int
	Contains(T) bool
	Add(T) bool
	Remove(T) bool
	AddAll(...T) bool
	Values() []T
}

func NewSet

func NewSet[T comparable]() Set[T]

type Stack

type Stack[T any] interface {
	Collection[T]
	Push(value T)
	Pop() T
}

func NewStack

func NewStack[T any](capacity int) Stack[T]

Jump to

Keyboard shortcuts

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