tonybhaskar / linked-list-repository

This repository contains a Python implementation of a Linked List. It includes basic operations such as insertion (append, prepend, insert at position), deletion (pop, delete at position), reversal, and traversal. The code demonstrates how to manage and manipulate a dynamically sized collection of elements efficiently.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linked List Implementation in Python

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.

Features

  • 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.

Usage

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

About

This repository contains a Python implementation of a Linked List. It includes basic operations such as insertion (append, prepend, insert at position), deletion (pop, delete at position), reversal, and traversal. The code demonstrates how to manage and manipulate a dynamically sized collection of elements efficiently.


Languages

Language:Python 100.0%