package
Version:
v0.0.0-...-8b28c38
Opens a new window with list of versions in this module.
Published: Oct 20, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 0
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 {
}
NewStack creates a new Stack[T]
Length returns the total number of elements on the stack.
func (s *Stack[T]) Pop() T
Pop the top item of the stack and return it
func (s *Stack[T]) Push(value T)
Push adds a value to the top of the stack.
func (s *Stack[T]) Top() T
Top returns the item on the top of the stack
Source Files
¶
Click to show internal directories.
Click to hide internal directories.