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

Method pop

javascript/08_stack/StackBasedOnLinkedList.js:27–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25 }
26 }
27 pop() {
28 if (this.top === null) {
29 return -1
30 }
31 const value = this.top.element
32 this.top = this.top.next
33 return value
34 }
35 // 为了实现浏览器前进后退
36 clear() {
37 this.top = null

Callers 4

backMethod · 0.45
frontMethod · 0.45
getMaxMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected