Documentation
¶
Overview ¶
Package stack implements a generic LIFO stack.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stack ¶
type Stack[E any] []E
Stack is a generic LIFO stack.
func (*Stack[E]) Backward ¶
Backward returns an iterator over index-value pairs in the stack, traversing it backward with descending indices.
func (*Stack[E]) Peek ¶
func (s *Stack[E]) Peek() E
Peek returns the top value of the stack without removing it. If the stack is empty, it panics.
Click to show internal directories.
Click to hide internal directories.