Documentation
¶
Overview ¶
Package stack provides a thread-safe stack implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack is a thread-safe LIFO data structure.
func NewStack ¶
NewStack returns a new stack with its initial capacity equal to the received size and bounded set accordingly.
func (*Stack) Peek ¶
Peek returns the item at the top of the stack without popping it. If the stack is empty, it will return nil
func (*Stack) Push ¶
Push an item on the stack. An error will occur is the stack is bounded and at capacity.
Click to show internal directories.
Click to hide internal directories.