A python library to handle dataStructures
Project description
updated: Wednesday, 29th December 2021
dataStax
What's New?
- Included Priority Queue
- Replaced Bad Implementation of max heap with arrays to true tree implementation
- Added Proper MinHeap DataStructure
- OverFlow and UnderFlow Errors
Table of Contents
Introduction
-
This is a very simple yet powerful project to implement day to day abstract data structures.
-
A pure implementation of Python in representing Trees and Linkedlists in basic command prompt
-
It helps visualize each data structure for better understanding
-
Students can be beneficial in using this Package
-
This project is still under construction
Problem Statement
- Often in the beginning CS students face problems in understanding the internal architecture of ADTs
- While solving coding challenges locally where test cases have to be written using these ADTs, it becomes really cumbersome to write these data structures from scratch.
- Often while writing a programs implementing these ADS we encounter lots of errors just because we are unable to preview what's actually going on under the hood.
Benefits
- Instant installation
- Quick Updates
- Very small size
- No extra modules required
- Written purely from scratch
- Easy Documentation [Upcoming]
- Command Line Demo
Requirements
- Runs on latest Python 3.7+
- This Library requires no extra modules
Installation
- Use the python package manager pip to install datastax.
pip install datastax
Usage
Demo
-
To get a demo of the library use the following command
- Windows:
> py -m datastax
- Unix based systems:
$ python -m datastax
- Result
Available modules are: 1. LinkedLists 2. Trees 3. Arrays Usage $ py datastax <data-structure> [data] Data Structures: -> trees Hierarchical DS -> linkedlists Linear DS -> arrays Fixed Size Linear DS
-
Then follow as the instruction guides
> py -m datastax linkedlist 1 2 3 4
Visuals for LinkedLists:
1. Singly Linked List:
Node[1] -> Node[2] -> Node[3] -> Node[4] -> NULL
2. Doubly Linked List:
NULL <-> Node[1] <-> Node[2] <-> Node[3] <-> Node[4] <-> NULL
...
Practical Usage
from datastax.trees import BinaryTree
bt = BinaryTree([1, 2, 3, 4, 5])
print(bt)
## OUTPUT:
"""
1
┌─────┴─────┐
2 3
┌──┴──┐
4 5
"""
---------------------------------------------------
from datastax.trees import MinHeapTree
MiHT = MinHeapTree([1, 2, 4, 2, 6, 5, 9, 18, 3, 2])
print(MiHT)
## OUTPUT
"""
1
┌───────────┴───────────┐
2 4
┌─────┴─────┐ ┌─────┴─────┐
2 2 5 9
┌──┴──┐ ┌──┘
18 3 6
"""
What's Next
- Implementation of Sum Segment Tree, Expression Tree
- Proper tests using UnitTest Lib
- Enhanced Documentation
- Implementation of Other Abstract data types like LRU_CACHE, LFU_CACHE, SKIP_LIST
- If things go accordingly I am planning to implement threaded binary tree. Seems a completely impossible task to show threads nut I'll try my best
- Beautification of README.md
Upcoming
from datastax.trees import ThreadedBinaryTree as Tbt
tbt = Tbt(['a', 'b', 'c', 'd', 'e'])
"""
Example 3:
a
┌─────┴─────┐
b │ └────c
┌──┴──┐ │
d─┘ └─e─┘
"""
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
datastax-0.1.0.tar.gz
(15.1 kB
view details)
Built Distribution
datastax-0.1.0-py3-none-any.whl
(18.8 kB
view details)
File details
Details for the file datastax-0.1.0.tar.gz
.
File metadata
- Download URL: datastax-0.1.0.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d96a56425741e042aa7789a13b37cf40756d0d2af6f1768f825ff7eb746825b0 |
|
MD5 | 7e6b96f3f8dd53bb90817951a019262d |
|
BLAKE2b-256 | 8e9e365d815c9689d99a562b091ae051cb912c49c58cdc34db3c2baab381f378 |
File details
Details for the file datastax-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: datastax-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28af6350aba05fd7470780779bc244b40d9b99da396c0617c50e13e83b71ac35 |
|
MD5 | c1df867297ff36796e795b7b8520dd8f |
|
BLAKE2b-256 | b05b07a67f1d6e007e5831425cb5fe0cb711f19d1d1d1343cad8aaf4063f2b45 |