Skip to main content

A professional and well-documented data structures package for Python.

Project description

pydscollections

pydscollections is a professional, educational, and production-friendly Python package that provides commonly used Data Structures and Algorithms (DSA) building blocks.

Author: Sanjay Saravanan M.Tech (IIT Madras)

Why pydscollections?

  • Clean and consistent APIs.
  • Strong type hints for better IDE support.
  • Thorough inline documentation.
  • Easy to install and publish on PyPI.
  • Tested with pytest.

Included Data Structures

Linear

  • DynamicArray[T]
  • Stack[T]
  • Queue[T]
  • Deque[T]
  • SinglyLinkedList[T]

Trees

  • BinarySearchTree[T]

Graphs

  • Graph[T] (adjacency-list based)

Priority Structures

  • MinHeap[T]

Installation

pip install pydscollections

Quick Start

from pydscollections import Stack, Queue, BinarySearchTree

stack = Stack[int]()
stack.push(10)
stack.push(20)
print(stack.pop())   # 20

queue = Queue[str]()
queue.enqueue("a")
queue.enqueue("b")
print(queue.dequeue())  # "a"

bst = BinarySearchTree[int]()
for value in [10, 5, 15, 12]:
    bst.insert(value)

print(12 in bst)          # True
print(list(bst.in_order()))  # [5, 10, 12, 15]

Project Layout

src/pydscollections/
  __init__.py
  linear.py
  tree.py
  graph.py
  heap.py
tests/

License

MIT License

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

pydscollections-0.1.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

pydscollections-0.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file pydscollections-0.1.1.tar.gz.

File metadata

  • Download URL: pydscollections-0.1.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pydscollections-0.1.1.tar.gz
Algorithm Hash digest
SHA256 81e1ea8925cc347f4de25216aa10acdfd27edefbc2213655c7f128a111e1304e
MD5 1af6cf44190ea41fb71520b6cf76727d
BLAKE2b-256 9f2fae7c5251b28fcaebcff82beac91bd28e4313d9ef4eeaf0060db83d6320f5

See more details on using hashes here.

File details

Details for the file pydscollections-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pydscollections-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1282c7077e8d3f68664245708543903f9aa649ff797975b64c34dc6402d065d
MD5 8145ecadb651bc5714f97ddf5ef2e8a2
BLAKE2b-256 d15d98878029ae6778d2171250a9ceffaa02c51c6220f3f04642b2f0c840b4c9

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