sll

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: 0

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 Node

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

func (*Node) Next

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

func (*Node) SetVal

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

func (*Node) Val

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

type SLL

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

func New

func New() SLL

func (*SLL) Append

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

func (*SLL) AppendNode

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

func (*SLL) GetAt

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

func (*SLL) GetNodeAt

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

func (*SLL) Head

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

func (*SLL) HeadNode

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

func (*SLL) InsertAt

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

func (*SLL) InsertNodeAt

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

func (*SLL) Length

func (l *SLL) Length() int

func (*SLL) Prepend

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

func (*SLL) PrependNode

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

func (*SLL) Remove

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

func (*SLL) RemoveAt

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

func (*SLL) RemoveNode

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

func (*SLL) Tail

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

func (*SLL) TailNode

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

Jump to

Keyboard shortcuts

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