MCPcopy Index your code
hub / github.com/careercup/ctci / Push

Method Push

Go/Chapter 3/stack/stack.go:29–32  ·  view source on GitHub ↗

Push a new element onto the stack

(value int)

Source from the content-addressed store, hash-verified

27
28// Push a new element onto the stack
29func (s *Stack) Push(value int) {
30 s.top = &Element{value, s.top}
31 s.size++
32}
33
34// Remove the top element from the stack and return it's value
35// If the stack is empty, return nil

Callers 2

StringMethod · 0.95
RandomStackFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected