package
Version:
v2.4.0
Opens a new window with list of versions in this module.
Published: Jul 26, 2024
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
¶
type Stack[T any] struct {
}
Stack is a last-in-first-out data structure
func (s *Stack[T]) Clear()
Clear empty the stack
IsEmpty checks if stack is empty
Len returns the length of the stack.
Peek helps view the top item on the stack
Pop removes and return top element of stack. Return false if stack is empty.
func (s *Stack[T]) Push(item T)
Push a new value onto the stack
Source Files
¶
Click to show internal directories.
Click to hide internal directories.