πΏ Laity Data Structures¶
Laity Data Structures is a Python package that provides simple and educational implementations of essential non-primitive data structures such as stacks, queues, linked lists, and binary search trees.
Whether you're a student, a developer preparing for interviews, or someone curious about how data structures work under the hood β this package is for you.
β¨ Features¶
- β Easy-to-read Python code
- π§± Stack, Queue, Linked List, Binary Search Tree implementations
- π Educational method names and documentation
- π¦ Simple pip installation
- π Ideal for learning & teaching
π¦ Installation¶
pip install laity-data-structures
Once installed, you can import any class into your project:
from laity.stack import Stack
s = Stack()
s.push(10)
s.push(20)
s.display() # Output: [10, 20]
π§° Data Structures Included¶
π Stack¶
A Last-In, First-Out (LIFO) linear data structure.
stack.push(value)
stack.pop()
stack.peek()
stack.is_empty()
stack.size()
stack.display()
π€ Queue¶
A First-In, First-Out (FIFO) linear structure for sequential data processing.
queue.enqueue(value)
queue.dequeue()
queue.peek()
queue.rear()
queue.is_empty()
queue.display()
π Singly Linked List¶
A series of nodes connected using pointers. Efficient for insertions and deletions.
linked_list.insert(value)
linked_list.insertAtBeginning(value)
linked_list.insertAfter(index, new_value)
linked_list.delete(value)
linked_list.search(value)
linked_list.traverse()
linked_list.display()
π³ Binary Search Tree (BST)¶
A hierarchical structure where each node has at most two children. Left child < node < right child.
bst.insert(value)
bst.search(value)
bst.printInOrder()
bst.printPreOrder()
bst.printPostOrder()
π Project Structure¶
laity-data-structures-py/
β
βββ laity/
β βββ stack.py
β βββ queue.py
β βββ linked_list.py
β βββ tree.py
β
βββ examples/
β βββ stack_test.ipynb
β βββ queue_test.ipynb
β βββ linked_list_test.ipynb
β βββ tree_test.ipynb
β
βββ README.md
βββ setup.py
βββ LICENSE
π€ Contributing¶
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
π License¶
This project is licensed under the MIT License β see the LICENSE file for details.
π Acknowledgements¶
Created with β€οΈ by PappaLaity
Inspired by educational goals and the love of clean, simple code.
π Ready to Explore?¶
Install it, play with it, modify it β and level up your understanding of data structures one line at a time.
pip install laity-data-structures