MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / Push

Method Push

structure/stack/stacklinkedlistwithlist.go:23–25  ·  view source on GitHub ↗

Push add a value into our stack

(val any)

Source from the content-addressed store, hash-verified

21
22// Push add a value into our stack
23func (sl *SList) Push(val any) {
24 sl.Stack.PushFront(val)
25}
26
27// Peak is return last value that insert into our stack
28func (sl *SList) Peek() (any, error) {

Callers 1

Calls

no outgoing calls

Tested by 1