stack

package
v0.0.0-...-f1db74e Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: GPL-3.0, LGPL-2.1 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmpty = errors.New("empty stack")

Functions

func New

func New[T any]() *stackG[T]

Types

type Cell

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

func (*Cell) AddAfter

func (me *Cell) AddAfter(after *Cell)

func (*Cell) DeleteAfter

func (me *Cell) DeleteAfter() *Cell

type HayStack

type HayStack []any

func (HayStack) Cap

func (stack HayStack) Cap() int

func (HayStack) IsEmpty

func (stack HayStack) IsEmpty() bool

func (HayStack) Len

func (stack HayStack) Len() int

func (*HayStack) Pop

func (stack *HayStack) Pop() (interface{}, error)

func (*HayStack) Push

func (stack *HayStack) Push(x interface{})

func (HayStack) Top

func (stack HayStack) Top() (interface{}, error)

type LinkedList

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

func MakeLinkedList

func MakeLinkedList() LinkedList

func (*LinkedList) IsEmpty

func (stack *LinkedList) IsEmpty() bool

func (*LinkedList) Length

func (list *LinkedList) Length() int

func (*LinkedList) Pop

func (stack *LinkedList) Pop() int

Pop an item off of the list (from right after the sentinel).

func (*LinkedList) Push

func (stack *LinkedList) Push(value int)

Push an item onto the top of the list right aftr the sentinel.

Jump to

Keyboard shortcuts

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