py-ds-academy¶
๐ฏ About¶
py-ds-academy is a comprehensive collection of classic data structures implemented from scratch in Python. The goal is learning + correctness (with tests), not squeezing out every last micro-optimization.
This project serves as both a learning resource and a reference implementation for common data structures used in computer science and software engineering.
โจ Features¶
- ๐งฑ Core Data Structures - Stacks, queues, linked lists, trees, and heaps
- ๐ Type Hints - Full type annotations for better code clarity
- ๐งช Comprehensive Tests - TDD-first approach with pytest
- ๐ Well Documented - Clear APIs with complexity notes
- ๐ Educational - Perfect for learning data structures
๐ Quick Start¶
>>> from py_ds import Stack, Queue, MinHeap, BinarySearchTree
>>> # Stack example
>>> s = Stack([1, 2, 3])
>>> s.pop()
3
>>> # Queue example
>>> q = Queue([1, 2, 3])
>>> q.dequeue()
1
>>> # Heap example
>>> h = MinHeap([3, 1, 4, 1, 5])
>>> h.pop()
1
๐ฆ Implemented Data Structures¶
Linear Structures¶
- โ Stack - LIFO stack with list backing
- โ Queue - FIFO queue with list backing
- โ LinkedList - Single-direction linked list
- โ DoublyLinkedList - Double-direction linked list
Trees¶
- โ BinaryTree - Generic binary tree with multiple traversal methods
- โ BinarySearchTree - Binary search tree with insert, remove, search
- โ AVLTree - Self-balancing AVL tree
Heaps¶
- โ MinHeap - Minimum binary heap
- โ MaxHeap - Maximum binary heap
๐ Learning Resources¶
This project is designed to help you:
- Understand how data structures work under the hood
- Learn time and space complexity analysis
- Practice clean code and type hints
- See real-world implementations with tests
๐ Documentation¶
Explore the documentation to learn more:
- Getting Started - Installation and setup
- Data Structures - Overview of all implemented structures
- API Reference - Complete API documentation
๐ค Contributing¶
Contributions are welcome! See the Contributing Guide for details.
๐ License¶
This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ by Eytan Ohana