lists

package
v0.0.0-...-0e71bb7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyList error = fmt.Errorf("List is empty\n")

Functions

This section is empty.

Types

type CircularQueue

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

func NewCircularQueue

func NewCircularQueue[T any](size int) *CircularQueue[T]

func (*CircularQueue[T]) Read

func (cq *CircularQueue[T]) Read() T

func (*CircularQueue[T]) Write

func (cq *CircularQueue[T]) Write(newElements []T)

type LinkedList

type LinkedList[K any, T any] struct {
	// contains filtered or unexported fields
}

LinkedList operations are not thread safe.

func NewLinkedList

func NewLinkedList[K any, T any]() *LinkedList[K, T]

func (*LinkedList[K, T]) AddToBack

func (ll *LinkedList[K, T]) AddToBack(key K, val T) *ListNode[K, T]

func (*LinkedList[K, T]) AddToFront

func (ll *LinkedList[K, T]) AddToFront(key K, val T) *ListNode[K, T]

func (*LinkedList[K, T]) Len

func (ll *LinkedList[K, T]) Len() int

func (*LinkedList[K, T]) MoveToFront

func (ll *LinkedList[K, T]) MoveToFront(node *ListNode[K, T])

func (*LinkedList[K, T]) PopBack

func (ll *LinkedList[K, T]) PopBack() (*ListNode[K, T], error)

func (*LinkedList[K, T]) PopFront

func (ll *LinkedList[K, T]) PopFront() (*ListNode[K, T], error)

func (*LinkedList[K, T]) Remove

func (ll *LinkedList[K, T]) Remove(node *ListNode[K, T])

type ListNode

type ListNode[K any, T any] struct {
	Key   K
	Value T
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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