Skip to main content

Python package implementing essential data structures and algorithms

Project description

DataStruct-Kit 🚀

PyPI Version Python Versions License

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

  1. Clone the repository:

    git clone https://github.com/Pavansai20054/DataStruct-Kit.git
    cd DataStruct-Kit
    
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install development dependencies:

    pip install -e ".[dev]"
    
  4. Run tests:

    pytest
    
  5. 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:

  1. Fork the repository.
  2. Create your feature branch:
    git checkout -b feature/amazing-feature
    
  3. Commit your changes:
    git commit -m 'Add some amazing feature'
    
  4. Push to the branch:
    git push origin feature/amazing-feature
    
  5. 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


Thank you for using DataStruct-Kit!
Your feedback and contributions make this project better for everyone.

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

datastruct_kit-0.1.2.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datastruct_kit-0.1.2-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

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

Hashes for datastruct_kit-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4bafb11ddc5011f2c44716ba358d52454f8b0d55ab4aafa84820fac595dddac0
MD5 689a3fc459633f84c3bbda19993dceb9
BLAKE2b-256 8932d2d5c2c4fc824dac5ff0e3ebe8ca6ab70a9437931b85d6841875d33d4296

See more details on using hashes here.

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

Hashes for datastruct_kit-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 26b1360e088e5b092a0a3d0ce47e6593f9a3102b00bdf2825673479ae69851a9
MD5 8f938fd1f8d633529fd906766baf9bd4
BLAKE2b-256 93a52e763f5bde846f644cc8965c7897455398cfe951a0e4978ac64e56258a5c

See more details on using hashes here.

Supported by

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