linked

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: BSD-3-Clause Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinkedList

type LinkedList struct {
	Length int
	Head   *Node
	Tail   *Node
}

A doubly linked list. There is no synchronization. The fields are publically accessible to allow for easy customization.

func New

func New() *LinkedList

func (*LinkedList) Backwards

func (l *LinkedList) Backwards() (it types.KIterator)

func (*LinkedList) DequeBack

func (l *LinkedList) DequeBack() (item types.Hashable, err error)

func (*LinkedList) DequeFront

func (l *LinkedList) DequeFront() (item types.Hashable, err error)

func (*LinkedList) EnqueBack

func (l *LinkedList) EnqueBack(item types.Hashable) (err error)

func (*LinkedList) EnqueFront

func (l *LinkedList) EnqueFront(item types.Hashable) (err error)

func (*LinkedList) Equals

func (l *LinkedList) Equals(b types.Equatable) bool

Can be compared to any types.IterableContainer

func (*LinkedList) First

func (l *LinkedList) First() (item types.Hashable)

func (*LinkedList) Has

func (l *LinkedList) Has(item types.Hashable) bool

func (*LinkedList) Hash

func (l *LinkedList) Hash() int

func (*LinkedList) Items

func (l *LinkedList) Items() (it types.KIterator)

func (*LinkedList) Last

func (l *LinkedList) Last() (item types.Hashable)

func (*LinkedList) Less

func (l *LinkedList) Less(b types.Sortable) bool

Can be compared to any types.IterableContainer

func (*LinkedList) Pop

func (l *LinkedList) Pop() (item types.Hashable, err error)

func (*LinkedList) Push

func (l *LinkedList) Push(item types.Hashable) (err error)

func (*LinkedList) Size

func (l *LinkedList) Size() int

func (*LinkedList) String

func (l *LinkedList) String() string

type Node

type Node struct {
	Data       types.Hashable
	Next, Prev *Node
}

A doubly linked list node.

func (*Node) Equals

func (n *Node) Equals(b types.Equatable) bool

Compares the Data of the node to the passed element.

func (*Node) Hash

func (n *Node) Hash() int

Hashes the Data of the node to the passed element.

func (*Node) Less

func (n *Node) Less(b types.Sortable) bool

Compares the Data of the node to the passed element.

type UniqueDeque

type UniqueDeque struct {
	// contains filtered or unexported fields
}

func NewUniqueDeque

func NewUniqueDeque() *UniqueDeque

A double ended queue that only allows unique items inside. Constructed from a doubly linked list and a linear hash table.

func (*UniqueDeque) Backwards

func (l *UniqueDeque) Backwards() (it types.KIterator)

func (*UniqueDeque) DequeBack

func (l *UniqueDeque) DequeBack() (item types.Hashable, err error)

func (*UniqueDeque) DequeFront

func (l *UniqueDeque) DequeFront() (item types.Hashable, err error)

func (*UniqueDeque) EnqueBack

func (l *UniqueDeque) EnqueBack(item types.Hashable) (err error)

func (*UniqueDeque) EnqueFront

func (l *UniqueDeque) EnqueFront(item types.Hashable) (err error)

func (*UniqueDeque) Equals

func (l *UniqueDeque) Equals(b types.Equatable) bool

Can be compared to any types.IterableContainer

func (*UniqueDeque) First

func (l *UniqueDeque) First() (item types.Hashable)

func (*UniqueDeque) Has

func (l *UniqueDeque) Has(item types.Hashable) bool

func (*UniqueDeque) Hash

func (l *UniqueDeque) Hash() int

func (*UniqueDeque) Items

func (l *UniqueDeque) Items() (it types.KIterator)

func (*UniqueDeque) Last

func (l *UniqueDeque) Last() (item types.Hashable)

func (*UniqueDeque) Less

func (l *UniqueDeque) Less(b types.Sortable) bool

Can be compared to any types.IterableContainer

func (*UniqueDeque) Pop

func (l *UniqueDeque) Pop() (item types.Hashable, err error)

func (*UniqueDeque) Push

func (l *UniqueDeque) Push(item types.Hashable) (err error)

func (*UniqueDeque) Size

func (l *UniqueDeque) Size() int

func (*UniqueDeque) String

func (l *UniqueDeque) String() string

Jump to

Keyboard shortcuts

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