Skip to main content

A Python package implementing singly, doubly, circular singly, and circular doubly linked lists.

Project description

linkedlistx

A Python package that provides implementations of four types of linked lists:

  • ✅ Singly Linked List (SLL)
  • ✅ Doubly Linked List (DLL)
  • ✅ Circular Singly Linked List (CLL)
  • ✅ Circular Doubly Linked List (DCLL)

This library is great for learning, teaching, or using classical linked list data structures in any Python project.


🧠 Features

  • Insert at beginning or end
  • Insert at a specific position (append)
  • Delete by index or value
  • Reverse the list
  • Find elements by value
  • Generate auto-filled lists (generate(n))
  • View list length or value at a position
  • Iterable linked lists (for node in list:)

Each list type preserves its structural characteristics (circularity, bidirectionality, etc.)


📁 Project Structure

linkedlistx/ ├── CLL.py # Circular Singly Linked List ├── DLL.py # Doubly Linked List ├── DCLL.py # Circular Doubly Linked List ├── SLL.py # Singly Linked List ├── node.py # Node classes ├── init.py # Unified imports

from linkedlistx import SingleLinkedList

sll = SingleLinkedList() sll.insert_at_beginning(10) sll.insert_at_end(20) sll.display() # Output: 10-> 20-> None


from linkedlistx import DoubleLinkedList

dll = DoubleLinkedList() dll.generate(5) dll.reverse() dll.display() # Output: 5-> 4-> 3-> 2-> 1-> None


from linkedlistx import CircularDoubleLinkedList

dcll = CircularDoubleLinkedList() dcll.insert_at_beginning(5) dcll.insert_at_end(15) dcll.display()

✅ Common to All Lists Method Description insert_at_beginning(data) Insert node at head insert_at_end(data) Insert node at tail append(data, pos) Insert at specified position delete(pos) Delete node at position remove(data) Delete first node with value update(pos, data) Update value at position show_val(pos) Print value at position show_len() Print number of nodes find(data) Print index of data or error generate(n) Auto-fill list with 1 to n del_at_start() Delete first node del_at_end() Delete last node reverse() Reverse the list display() Print node values iter() Make list iterable

🔩 Node Structure

SLL Node

class SLLNode: def init(self, data): self.data = data self.next = None

DLL Node

class DLLNode: def init(self, data): self.data = data self.prev = None self.next = None

🪪 License This project is licensed under the MIT License.

🤝 Contributing Contributions are welcome! Feel free to open issues or pull requests to enhance functionality, fix bugs, or suggest new features.

👤 Author Developed by Aswath 🫡 GitHub: https://github.com/aswath-maker

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

linkedlistx-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

linkedlistx-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file linkedlistx-0.1.0.tar.gz.

File metadata

  • Download URL: linkedlistx-0.1.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for linkedlistx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cfa2149d2716435efd435648f384e39a453d61511811877ea0d65109adf7d75a
MD5 d7c1cd8ff82d5611fc90a3bf809a4a51
BLAKE2b-256 aa8a3d1c2bb3ac13dd4c9ccc8240a73d2765fe930733ab0e05def258500ee2ff

See more details on using hashes here.

File details

Details for the file linkedlistx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: linkedlistx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for linkedlistx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a0c6d7756a75e266ae1a2c0f1f8868ad69ad210b00c1b82a3c12526c76f9472b
MD5 ac7d32dfbd998e91a2c290112602fe41
BLAKE2b-256 38b22886d1fcfce91f253322a3f8c0d76882f7db564dfc91ea9b834640cf88cb

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