MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / NewStack

Function NewStack

structure/stack/stackarray.go:17–19  ·  view source on GitHub ↗

NewStack creates and returns a new stack.

()

Source from the content-addressed store, hash-verified

15
16// NewStack creates and returns a new stack.
17func NewStack[T any]() *Array[T] {
18 return &Array[T]{}
19}
20
21// Push adds an element to the top of the stack.
22func (s *Array[T]) Push(value T) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected