Python package implementing essential data structures and algorithms
Project description
DataStruct-Kit 🚀
A Python package implementing essential data structures and algorithms with a focus on performance, usability, and scalability.
✨ Features
Sorting Algorithms 📊
- Bubble Sort
- Merge Sort
- Quick Sort
Searching Algorithms 🔍
- Linear Search
- Binary Search
Data Structures 🏗️
- HashTable
- Binary Tree
- AVL Tree
- Graph
Performance Utilities ⏱️
- Benchmarking tools for performance analysis.
- Complexity analysis for algorithm evaluation.
📦 Installation
Install DataStruct-Kit from PyPI:
pip install DataStruct-Kit
🚀 Quick Start
Example Usage
from DataStruct-Kit import bubble_sort, binary_search, HashTable, BinaryTree, dfs, bfs
# Sorting algorithms
data = [3, 1, 4, 1, 5, 9, 2, 6]
sorted_data = bubble_sort(data)
print(f"Sorted data: {sorted_data}")
# Using a hash table
ht = HashTable()
ht.put("name", "DataStruct-Kit")
ht.put("version", "0.1.0")
print(f"Value: {ht.get('name')}") # Output: DataStruct-Kit
# Working with binary trees
tree = BinaryTree()
for value in [5, 3, 7, 2, 4, 6, 8]:
tree.insert(value)
print(f"In-order traversal: {tree.inorder()}")
# Graph algorithms
graph = {'A': ['B', 'C'], 'B': ['D'], 'C': ['E'], 'D': [], 'E': []}
print(f"DFS: {dfs(graph, 'A')}") # Output: ['A', 'B', 'D', 'C', 'E']
print(f"BFS: {bfs(graph, 'A')}") # Output: ['A', 'B', 'C', 'D', 'E']
📊 Performance Benchmarks
You can measure the performance of algorithms using the measure_time utility:
from DataStruct-Kit.performance import measure_time
from DataStruct-Kit import bubble_sort, quick_sort
data = list(range(1000, 0, -1))
print(f"Bubble Sort: {measure_time(bubble_sort, data.copy()):.6f} seconds")
print(f"Quick Sort: {measure_time(quick_sort, data.copy()):.6f} seconds")
📚 Documentation
Full documentation is available at: DataStruct-Kit Documentation
🛠️ Development
Setting up the Development Environment
-
Clone the repository:
git clone https://github.com/Pavansai20054/DataStruct-Kit.git cd DataStruct-Kit
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install development dependencies:
pip install -e ".[dev]"
-
Run tests:
pytest
-
Type checking (optional):
pip install mypy mypy DataStruct-Kit/
📋 Roadmap
The following features are planned for future releases:
- Add more sorting algorithms (Heap Sort, Radix Sort).
- Implement priority queues.
- Add advanced tree structures (B-Tree, Red-Black Tree).
- Provide visualization utilities for data structures and algorithms.
- Support for parallel execution of algorithms.
🤝 Contributing
We welcome contributions! To contribute:
- Fork the repository.
- Create your feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add some amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request.
For detailed guidelines, refer to the CONTRIBUTING.md file.
📄 License
Distributed under the MIT License. See LICENSE for more information.
📬 Contact
- Rangdal Pavansai: Email | GitHub
- Project Link: DataStruct-Kit on GitHub
Thank you for using DataStruct-Kit!
Your feedback and contributions make this project better for everyone.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datastruct_kit-0.1.2.tar.gz.
File metadata
- Download URL: datastruct_kit-0.1.2.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bafb11ddc5011f2c44716ba358d52454f8b0d55ab4aafa84820fac595dddac0
|
|
| MD5 |
689a3fc459633f84c3bbda19993dceb9
|
|
| BLAKE2b-256 |
8932d2d5c2c4fc824dac5ff0e3ebe8ca6ab70a9437931b85d6841875d33d4296
|
File details
Details for the file datastruct_kit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: datastruct_kit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26b1360e088e5b092a0a3d0ce47e6593f9a3102b00bdf2825673479ae69851a9
|
|
| MD5 |
8f938fd1f8d633529fd906766baf9bd4
|
|
| BLAKE2b-256 |
93a52e763f5bde846f644cc8965c7897455398cfe951a0e4978ac64e56258a5c
|