MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / push

Method push

data_structures/stacks/stack.py:25–29  ·  view source on GitHub ↗

Push an element to the top of the stack.

(self, data)

Source from the content-addressed store, hash-verified

23 return str(self.stack)
24
25 def push(self, data):
26 """ Push an element to the top of the stack."""
27 if len(self.stack) >= self.limit:
28 raise StackOverflowError
29 self.stack.append(data)
30
31 def pop(self):
32 """ Pop an element off of the top of the stack."""

Callers 3

infix_to_postfixFunction · 0.95
balanced_parenthesesFunction · 0.95
stack.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected