MCPcopy
hub / github.com/TheAlgorithms/JavaScript / pop

Method pop

Data-Structures/Stack/Stack.js:26–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24
25 // Removes and returns the value at the end of the stack
26 pop() {
27 if (this.top === 0) {
28 return 'Stack is Empty'
29 }
30
31 this.top--
32 const result = this.stack[this.top]
33 this.stack = this.stack.splice(0, this.top)
34 return result
35 }
36
37 // Returns the size of the stack
38 size() {

Callers 15

convexHullFunction · 0.45
DFSIterativeMethod · 0.45
DFSComponentMethod · 0.45
kosarajuMethod · 0.45
longestValidParenthesesFunction · 0.45
findCombinationsFunction · 0.45
calcRPNFunction · 0.45
PalindromeIterativeFunction · 0.45
traverseDFSFunction · 0.45
searchDFSFunction · 0.45
removeVertexMethod · 0.45
DFSIterativeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected