MCPcopy Index your code
hub / github.com/0xAX/go-algorithms / Push

Method Push

stack/stack.go:23–26  ·  view source on GitHub ↗

Pushes a given item into Stack

(item interface{})

Source from the content-addressed store, hash-verified

21
22// Pushes a given item into Stack
23func (stack *Stack) Push(item interface{}) {
24 stack.sp = &StackItem{item: item, next: stack.sp}
25 stack.depth++
26}
27
28// Deletes top of a stack and return it
29func (stack *Stack) Pop() interface{} {

Callers 1

TestStackFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestStackFunction · 0.76