MCPcopy
hub / github.com/wangzheng0822/algo / push

Method push

javascript/08_stack/StackBasedOnLinkedList.js:18–26  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

16 this.top = null
17 }
18 push(value) {
19 const node = new Node(value)
20 if (this.top === null) {
21 this.top = node
22 } else {
23 node.next = this.top
24 this.top = node
25 }
26 }
27 pop() {
28 if (this.top === null) {
29 return -1

Callers 15

buildFailurePointerMethod · 0.45
buildFailurePointerMethod · 0.45
randKeyTestFunction · 0.45
randKeyTestFromObjFunction · 0.45
randKeyTestFromMapFunction · 0.45
GraphFunction · 0.45
pushNormalMethod · 0.45
backMethod · 0.45
frontMethod · 0.45
heap-sort.jsFile · 0.45
insertMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected