Aller au contenu

🌿 Laity Data Structures

Version Python License

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:

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