queuestack

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

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue interface {
	Enqueue(value interface{})
	Dequeue() (interface{}, error)
	Peek() (interface{}, error)
	Empty() bool
}

Queue represents a collection data structure with FIFO (First In First Out) semantics).

func NewQueue

func NewQueue() Queue

NewQueue returns an empty queue.

type Stack

type Stack interface {
	Push(value interface{})
	Pop() (interface{}, error)
	Peek() (interface{}, error)
	Empty() bool
}

Stack represents a collection data structure with LIFO (Last In First Out) semantics).

func NewStack

func NewStack() Stack

NewStack returns an empty stack.

Source Files

  • queue.go
  • stack.go

Jump to

Keyboard shortcuts

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