package
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Sep 5, 2023
License: MIT
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
¶
Package stack provides an implementation of the stack data structure in Go.
type Stack[T any] struct {
}
Stack is an implementation of stack.
Empty returns whether the stack is empty or not.
Size returns the size of the stack.
func (s *Stack[T]) Pop() T
Pop pops a value from the queue.
func (s *Stack[T]) Push(value T)
Push pushes a value into the stack.
func (s *Stack[T]) Top() T
Top returns the value at the top of the queue.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.