package
Version:
v0.0.0-...-5ac3f74
Opens a new window with list of versions in this module.
Published: Aug 2, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 4
Opens a new window with list of known importers.
Documentation
¶
Package stack is a tiny package implementing a generic stack.
A Stack.
Len returns the number of elements on the stack.
func (s *Stack[T]) Pop() T
Pop returns the topmost element from the stack and removes it. Panics if the stack is empty.
func (s *Stack[T]) Push(v T)
Push v unto the stack.
func (s *Stack[T]) Top() T
Top returns the topmost element of the stack without removing it. Panics if the stack is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.