Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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]