Push a value onto the stack. Args: value: The value to push.
(self, value: object)
| 83 | probe -= 1 |
| 84 | |
| 85 | def push(self, value: object) -> None: |
| 86 | """Push a value onto the stack. |
| 87 | |
| 88 | Args: |
| 89 | value: The value to push. |
| 90 | """ |
| 91 | self._top += 1 |
| 92 | if self._top == len(self._array): |
| 93 | self._expand() |
| 94 | self._array[self._top] = value |
| 95 | |
| 96 | def pop(self) -> object: |
| 97 | """Remove and return the top element. |