Discover Packages
github.com/zeroflucs-given/generics
collections
stack
package
Version:
v0.0.0-...-e4e1d86
Opens a new window with list of versions in this module.
Published: Apr 9, 2024
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 6
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Stack[T any ] struct {
}
Stack is our type that implements a stack of data items
NewStack creates a new instance of a stack with an initial capacity
Capacity is the capacity of this stack. Stacks can grow until memory
is depleted today.
Count of the data inside the stack
Peek the item that would be returned from pop. Note that for LIFO situations the
list consumer must mutex, otherwise the next Pop may yield a different element
Pop a value from the stack
Push a value into the stack
Source Files
¶
Click to show internal directories.
Click to hide internal directories.