stack

package
v0.0.0-...-5c8b7b9 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: CC0-1.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStackOverflow = errors.New("pila llena")
View Source
var ErrStackUnderflow = errors.New("pila vacia")

Sugerencia: Go Effective

Functions

This section is empty.

Types

type ArrayStack

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

func New

func New(capacidad int) ArrayStack

func (*ArrayStack) Clear

func (pila *ArrayStack) Clear()

func (ArrayStack) IsEmpty

func (pila ArrayStack) IsEmpty() bool

func (ArrayStack) IsFull

func (pila ArrayStack) IsFull() bool

func (*ArrayStack) Pop

func (pila *ArrayStack) Pop() (e int, err error)

func (*ArrayStack) Push

func (pila *ArrayStack) Push(e int) (err error)

func (ArrayStack) Size

func (pila ArrayStack) Size() int

func (ArrayStack) Top

func (pila ArrayStack) Top() (e int, err error)

type Stack

type Stack interface {
	Clear()            // Limpiar la estructura -> O(1)
	Push(e int) error  // Agregar un nuevo elemento (cima) -> O(1)
	Top() (int, error) // Mostrar el elemento de la cima -> O(1)
	Pop() (int, error) // Mostrar el elemento de la cima. Remueve la cima actual -> O(1)
	Size() int         // Cantidad de elementos en la pila -> O(1)
}

Jump to

Keyboard shortcuts

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