Skip to main content

A set of useful data structures, including circular queue, binary tree/graph, linked list, and stack.

Project description

iron_datastructures

This is a set of (potentially) useful data structures, including:

  • circular queue
  • graph/binary tree
  • linked list
  • stack

And, each data structure has some pretty epic methods built in. For example, the graph has both a depth first and a breadth first search built right in! Take a look at it!

What's different about this package, eh? Just another bunch of random data structures.

…to which I say, not so fast! This package is designed with type safety in mind. It is 100% type hinted, to give you that extra peace of mind when writing great code.

Not only this, but there are of course tests built in! Run them easily with python3 -m doctest datastructures/*.py (add a -v for extra verbosity!).

And there's more! This package has useful examples of what you can do with each data structure. Simply take a look at the source files - for example, circular_queue.py:

Initialize a queue and add an acceptable number of items to it:
>>> myQueue = CircularQueue[str](6)
>>> myQueue.enQueue("Hello")
>>> myQueue.enQueue("there,")
>>> myQueue.enQueue("I")
>>> myQueue.enQueue("am")
>>> myQueue.enQueue("an")
>>> myQueue.enQueue("octopus.")

Check queue is full:
>>> myQueue.isFull()
True

Try to add too many items:
>>> myQueue.enQueue("overflow!")
Traceback (most recent call last):
    ...
Exception: Queue is full

This cool example, and many more like it, are bundled right up in the very same source files you'll be using in whatever fantabulous, exquisite creation you're working on.

Enjoy!

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

iron_datastructures-1.1.tar.gz (16.3 kB view hashes)

Uploaded Source

Built Distribution

iron_datastructures-1.1-py3-none-any.whl (33.1 kB view hashes)

Uploaded Python 3

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