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 iron_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file iron_datastructures-1.4.tar.gz
.
File metadata
- Download URL: iron_datastructures-1.4.tar.gz
- Upload date:
- Size: 28.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ff04ee484baef3ffa3ad759eb08e02a5d8e3320f727e54ffdf1ad8979b79567 |
|
MD5 | abd29c9aa7a338648b88fc15c0273158 |
|
BLAKE2b-256 | c94cc17a3c2411b2a998efac7199a18718b2a0dae0d9b20854a70e1f7f87dc8a |
File details
Details for the file iron_datastructures-1.4-py3-none-any.whl
.
File metadata
- Download URL: iron_datastructures-1.4-py3-none-any.whl
- Upload date:
- Size: 33.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2e901d042fb1f0edc51e577b4e0f1bea0998880f033763221d36d932c2315ed |
|
MD5 | fcce2ae66536d9d3d0b607b3de665d8f |
|
BLAKE2b-256 | 538cadd12699b82d3010d05dd0399449b4a87dce6a591978b121982824ee027f |