MCPcopy Index your code
hub / github.com/subbarayudu-j/TheAlgorithms-Python / pop

Method pop

data_structures/stacks/stack.py:31–36  ·  view source on GitHub ↗

Pop an element off of the top of the stack.

(self)

Source from the content-addressed store, hash-verified

29 self.stack.append(data)
30
31 def pop(self):
32 """ Pop an element off of the top of the stack."""
33 if self.stack:
34 return self.stack.pop()
35 else:
36 raise IndexError('pop from an empty stack')
37
38 def peek(self):
39 """ Peek at the top-most element of the stack."""

Callers 15

infix_to_postfixFunction · 0.95
balanced_parenthesesFunction · 0.95
collect_datasetFunction · 0.45
sentinel_linear_searchFunction · 0.45
tabu_searchFunction · 0.45
dfsFunction · 0.45
dfsFunction · 0.45
kruskFunction · 0.45
bfsFunction · 0.45
topologicalSortFunction · 0.45
searchFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected