MCPcopy Create free account
hub / github.com/GoTurkiye/training / Pop

Method Pop

301-algorithms/linear-lists/stack/stack.go:27–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25}
26
27func (s *Stack) Pop() MyItem {
28 if s.depth > 0 {
29 s.depth--
30 return s.list[s.depth]
31 }
32 return -1
33}
34
35func main() {
36 stack := NewStack(4)

Callers 1

mainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected