Documentation ¶
Index ¶
- Constants
- Variables
- type ErrEmptyStack
- type ErrFullStack
- type Stack
- func (stack *Stack[T]) Clear()
- func (stack Stack[T]) IsEmpty() bool
- func (stack Stack[T]) IsFull() bool
- func (stack Stack[T]) Peek() T
- func (stack *Stack[T]) Pop() T
- func (stack *Stack[T]) Push(value T)
- func (stack Stack[T]) Size() int
- func (stack *Stack[T]) String() string
- func (stack *Stack[T]) ToSlice() []T
Constants ¶
View Source
const ( // linked_stack with no maximum size Implementation LINKED int = iota // ArrayStack with no maximum size Implementation ARRAY )
Variables ¶
View Source
var ( StackHead string = " | →" StackSep string = " | " )
Functions ¶
This section is empty.
Types ¶
type ErrEmptyStack ¶
type ErrEmptyStack struct{}
func (ErrEmptyStack) Error ¶
func (e ErrEmptyStack) Error() string
type ErrFullStack ¶
type ErrFullStack struct{}
func (ErrFullStack) Error ¶
func (e ErrFullStack) Error() string
type Stack ¶
type Stack[T any] struct { // contains filtered or unexported fields }
func NewLimitedStack ¶
Click to show internal directories.
Click to hide internal directories.