dll

package
v0.0.0-...-1f982ba Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyList   = errors.New("cannot perform operation in empty list")
	ErrOutOfBounds = errors.New("index exceeds length of list")
	ErrNotInList   = errors.New("value not in list")
)
View Source
var (
	ErrNotSet = errors.New("node not set")
)

Functions

This section is empty.

Types

type DLL

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

func New

func New() DLL

func (*DLL) Append

func (l *DLL) Append(val interface{})

func (*DLL) AppendNode

func (l *DLL) AppendNode(n *Node)

func (*DLL) GetAt

func (l *DLL) GetAt(idx int) (interface{}, error)

func (*DLL) GetNodeAt

func (l *DLL) GetNodeAt(idx int) (*Node, error)

func (*DLL) Head

func (l *DLL) Head() (interface{}, error)

func (*DLL) HeadNode

func (l *DLL) HeadNode() (*Node, error)

func (*DLL) InsertAt

func (l *DLL) InsertAt(idx int, val interface{}) error

func (*DLL) InsertNodeAt

func (l *DLL) InsertNodeAt(idx int, n *Node) error

func (*DLL) Length

func (l *DLL) Length() int

func (*DLL) Prepend

func (l *DLL) Prepend(val interface{})

func (*DLL) PrependNode

func (l *DLL) PrependNode(n *Node)

func (*DLL) Remove

func (l *DLL) Remove(val interface{}) error

func (*DLL) RemoveAt

func (l *DLL) RemoveAt(idx int) error

func (*DLL) RemoveNode

func (l *DLL) RemoveNode(n *Node) error

func (*DLL) Tail

func (l *DLL) Tail() (interface{}, error)

func (*DLL) TailNode

func (l *DLL) TailNode() (*Node, error)

type Node

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

func (*Node) Next

func (n *Node) Next() (*Node, error)

func (*Node) Prev

func (n *Node) Prev() (*Node, error)

func (*Node) SetVal

func (n *Node) SetVal(val interface{})

func (*Node) Val

func (n *Node) Val() interface{}

Jump to

Keyboard shortcuts

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