https://github.com/kylepw/multistack
Example of multiple stacks in one array.
https://github.com/kylepw/multistack
algorithms array data data-structures python stack
Last synced: about 1 year ago
JSON representation
Example of multiple stacks in one array.
- Host: GitHub
- URL: https://github.com/kylepw/multistack
- Owner: kylepw
- License: mit
- Created: 2019-09-16T08:10:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-22T03:32:57.000Z (over 6 years ago)
- Last Synced: 2025-01-24T04:52:01.574Z (about 1 year ago)
- Topics: algorithms, array, data, data-structures, python, stack
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
==========
multistack
==========
Example of multiple stacks in one array.
Usage::
>>> s = MultiStack(num=4, size=4)
>>> s.push(stack=1, value=35)
>>> s.push(1, 10)
>>> s.push(0, 2)
>>> s.push(2, -33)
>>> s.peek(stack=1)
10
>>> s.pop(stack=2)
-33
>>> print(s)
[None, None, None, 2, None, None, 10, 35, None, None, None, None, None, None, None, None]