package
Version:
v0.6.0
Opens a new window with list of versions in this module.
Published: Jan 3, 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[E any] struct {
}
func FromSlice[E any](elems ...E) *Stack[E]
FromSlice create a Stack from variadic elements.
IsEmpty check whether Stack is empty.
Iter make Stack to iter.Seq in pop order.
Peek returns the top element, without pop it.
Pop an element from Stack top.
Pop returns two results, the first is element and the second is a bool
that indicate the value whether is valid.
func (s *Stack[E]) Push(elem E)
Push an element to Stack top.
Size returns size of stack.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.