package
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: May 9, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Stack[T any] struct {
}
Stack represent generic stack.
Not a thread safe!
Get returns a value of the stack, without removing.
Len returns length of the stack.
func (s *Stack[T]) Peek() T
Peek returns a value of the stack from the end, without removing.
func (s *Stack[T]) Pop() T
Pop pops a value from the stack.
func (s *Stack[T]) Push(v T)
Push pushes a value onto the stack.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.