Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 2 months 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 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-22T03:32:57.000Z (over 5 years ago)
- Last Synced: 2024-01-15T21:56:55.702Z (almost 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]