Documentation ¶
Overview ¶
Package stack implements a stack built using a linked list.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stack ¶
type Stack[T any] struct { // contains filtered or unexported fields }
Stack is a stack that uses a linked list to store its elements.
The zero value for a Stack is an empty stack ready to use.
func (*Stack[T]) Peek ¶
func (s *Stack[T]) Peek() T
Peek returns the element at the top of the stack without removing it.
If the stack is of length 0, Peek will panic.
Click to show internal directories.
Click to hide internal directories.