This repository contains a Python implementation of a Linked List, showcasing various operations such as insertion, deletion, reversal, and traversal. The Linked List is a fundamental data structure that allows for efficient management of dynamically sized collections of elements.
- Node Class: Represents each element in the linked list, containing data and a reference to the next node.
- LinkedList Class: Manages the linked list with methods for various operations.
- Insertion:
append(data)
: Insert a node at the end of the list.prepend(data)
: Insert a node at the beginning of the list.insert(data, position)
: Insert a node at a specific position.
- Deletion:
pop()
: Remove and return the last node.delete_at(position)
: Remove a node at a specific position.
- Other Operations:
size()
: Return the number of nodes in the list.reverse()
: Reverse the order of nodes in the list.print_list()
: Print the linked list in a readable format.
- Insertion:
To get started, clone the repository and explore the linked_list.py
file to understand the implementation details and see example usage.
git clone https://github.com/TonyBhaskar/linked-list-repository
cd linked-list-implementation