Skip to main content

Some widely used data structures

Project description

py-data-structures

Python implementation of abstract data structures

Install

pip install py-data-structures

Stack

Usage

from data_structures import Stack

stack = Stack()
stack.push(item)  # push an item in stack
stack.pop()  # returns the top item from the stack
stack.length  # contains the length of the stack
stack.top  # contains the top item of the stack

stack.iterate()  # override to iterate or perform action on the stack elements

Exceptions

from data_structures import exceptions

# raised on pop() or top when stack is empty
exceptions.EmptyStackException   

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-data-structures-0.2.tar.gz (3.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page