doubly_linked_list

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DLL

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

cycles not supported

func NewDLL

func NewDLL[T any]() *DLL[T]

func (*DLL[T]) Head

func (d *DLL[T]) Head() *Node[T]

func (*DLL[T]) InsertAfter

func (d *DLL[T]) InsertAfter(val T, n *Node[T]) error

func (*DLL[T]) InsertBefore

func (d *DLL[T]) InsertBefore(val T, n *Node[T]) error

func (*DLL[T]) InsertNodeAfter

func (d *DLL[T]) InsertNodeAfter(newN, n *Node[T]) error

func (*DLL[T]) InsertNodeBefore

func (d *DLL[T]) InsertNodeBefore(newN, n *Node[T]) error

func (*DLL[T]) Len

func (d *DLL[T]) Len() int64

func (*DLL[T]) PeekHead

func (d *DLL[T]) PeekHead() (T, error)

func (*DLL[T]) PeekHeadN

func (d *DLL[T]) PeekHeadN(n int64) (T, error)

func (*DLL[T]) PeekHeadNode

func (d *DLL[T]) PeekHeadNode() *Node[T]

func (*DLL[T]) PeekTail

func (d *DLL[T]) PeekTail() (T, error)

func (*DLL[T]) PeekTailN

func (d *DLL[T]) PeekTailN(n int64) (T, error)

func (*DLL[T]) PeekTailNode

func (d *DLL[T]) PeekTailNode() *Node[T]

func (*DLL[T]) PopHead

func (d *DLL[T]) PopHead() (T, error)

func (*DLL[T]) PopTail

func (d *DLL[T]) PopTail() (T, error)

func (*DLL[T]) PushHead

func (d *DLL[T]) PushHead(val T)

func (*DLL[T]) PushTail

func (d *DLL[T]) PushTail(val T)

func (*DLL[T]) String

func (d *DLL[T]) String() string

func (*DLL[T]) Tail

func (d *DLL[T]) Tail() *Node[T]

type Node

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

func NewNode

func NewNode[T any](val T) *Node[T]

func (*Node[T]) HeadIndexIn

func (n *Node[T]) HeadIndexIn(dll *DLL[T]) (int64, error)

TODO: do these two need refactoring?

func (*Node[T]) Next

func (n *Node[T]) Next() *Node[T]

func (*Node[T]) Prev

func (n *Node[T]) Prev() *Node[T]

func (*Node[T]) RemoveFrom

func (n *Node[T]) RemoveFrom(dll *DLL[T]) error

func (*Node[T]) TailIndexIn

func (n *Node[T]) TailIndexIn(dll *DLL[T]) (int64, error)

func (*Node[T]) Val

func (n *Node[T]) Val() T

Jump to

Keyboard shortcuts

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