containers

package
v0.0.0-...-2552c51 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 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 struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue() *Queue

func (*Queue) Pop

func (s *Queue) Pop() (val interface{}, check bool)

func (*Queue) Push

func (s *Queue) Push(val ...interface{})

func (*Queue) Size

func (s *Queue) Size() int

type Stack

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

Sack struct

func NewStack

func NewStack(length int) *Stack

NewStack is constructor for stack

func (*Stack) Cap

func (s *Stack) Cap() int

Cap returns stack capacity

func (*Stack) Len

func (s *Stack) Len() int

Len returns stack size

func (*Stack) Peek

func (s *Stack) Peek() interface{}

Peek returns object on top

func (*Stack) Pop

func (s *Stack) Pop() (res interface{})

Pop get and return object on top

func (*Stack) PopAll

func (s *Stack) PopAll() []interface{}

PopAll get all elements and returns slice with elements

func (*Stack) PopAllIndex

func (s *Stack) PopAllIndex(index int) []interface{}

Забирает стек до индекса (если в стеке, например, 5 элементов, индекс = 2, из стека будет взято 3 элемента)

func (*Stack) PopAllReverse

func (s *Stack) PopAllReverse() []interface{}

Разворачивает стек, забирает все элементы и возвращает их в срезе

func (*Stack) PopAllReverseIndex

func (s *Stack) PopAllReverseIndex(index int) []interface{}

Забирает элементы из стека до индекса, разворачивает результат и возвращает его в срезе

func (*Stack) Push

func (s *Stack) Push(vals ...interface{})

Push setup object in top

func (*Stack) String

func (s *Stack) String() string

String returns description string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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