Documentation ¶
Index ¶
- 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
- type StackImplementationType
Constants ¶
This section is empty.
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 ¶
func NewLimitedStack[T any](implementation StackImplementationType, capacity int, values ...T) Stack[T]
func NewStack ¶
func NewStack[T any](implementation StackImplementationType, values ...T) Stack[T]
type StackImplementationType ¶ added in v0.2.1
type StackImplementationType int
const ( LinkedStack StackImplementationType = iota ArrayStack )
func (StackImplementationType) String ¶ added in v0.2.1
func (implementation StackImplementationType) String() string
Click to show internal directories.
Click to hide internal directories.