MCPcopy Index your code
hub / github.com/arnauddri/algorithms / Push

Method Push

data-structures/stack/stack.go:42–50  ·  view source on GitHub ↗
(el interface{})

Source from the content-addressed store, hash-verified

40}
41
42func (s *Stack) Push(el interface{}) {
43 s.lock.Lock()
44 defer s.lock.Unlock()
45
46 prepend := make([]interface{}, 1)
47 prepend[0] = el
48 s.stack = append(prepend, s.stack...)
49 s.len++
50}
51
52func (s *Stack) Peek() interface{} {
53 s.lock.Lock()

Callers 6

TestNewFunction · 0.45
ChangePriorityMethod · 0.45
SortFunction · 0.45
SccFunction · 0.45
UndirectedDfsFunction · 0.45
DirectedDfsFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestNewFunction · 0.36