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.
- ✅ 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
- You can check the documentation website
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]
A Last-In, First-Out (LIFO) linear data structure.
stack.push(value)
stack.pop()
stack.peek()
stack.is_empty()
stack.size()
stack.display()
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()
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()
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()
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
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
This project is licensed under the MIT License — see the LICENSE file for details.
Created with ❤️ by PappaLaity
Inspired by educational goals and the love of clean, simple code.
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