MCPcopy
hub / github.com/trekhleb/javascript-algorithms / pop

Method pop

src/data-structures/stack/Stack.js:44–49  ·  view source on GitHub ↗

* @return {*}

()

Source from the content-addressed store, hash-verified

42 * @return {*}
43 */
44 pop() {
45 // Let's try to delete the first node (the head) from the linked list.
46 // If there is no head (the linked list is empty) just return null.
47 const removedHead = this.linkedList.deleteHead();
48 return removedHead ? removedHead.value : null;
49 }
50
51 /**
52 * @return {*[]}

Callers 15

isValidFunction · 0.95
pollMethod · 0.80
pollMethod · 0.80
pollMethod · 0.80
removeMethod · 0.80
Stack.test.jsFile · 0.80
dpTopDownJumpGameFunction · 0.80
backtrackingJumpGameFunction · 0.80
btUniquePathsFunction · 0.80
knightTourRecursiveFunction · 0.80
hanoiTowerRecursiveFunction · 0.80
sortMethod · 0.80

Calls 1

deleteHeadMethod · 0.45

Tested by

no test coverage detected