Skip to content

aditya2819/LinkedList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Singly Linked List Python Implementation

This Python code provides an implementation of a singly linked list and demonstrates various operations on it. A singly linked list is a linear data structure where elements are stored in a sequence, and each element points to the next element in the list.

Features

The provided code includes the following features and operations for a singly linked list:

  1. Node Class:

    • The Node class represents a single node in the linked list. It contains data and a reference to the next node.
  2. Singly Linked List Class:

    • The LinkedList class represents the singly linked list. It includes the following operations:
      • Insertion at the Beginning: Add an element to the beginning of the list.
      • Insertion at the End: Add an element to the end of the list.
      • Insertion at a Specific Index: Add an element at a specific index.
      • Deletion from the Beginning: Remove the first element from the list.
      • Deletion from the End: Remove the last element from the list.
      • Deletion at a Specific Index: Remove an element at a specific index.
      • Deletion by Value: Remove an element with a specific value.
      • Updating an Element at a Specific Index: Modify an element at a specific index.
      • Updating an Element by Value: Modify an element by its value.
      • Printing the Linked List: Display the elements in the linked list.
      • Returning Value at a Specific Index: Retrieve the value at a specific index.
      • Returning Index of a Specific Value: Find the index of a specific value.
      • Getting the Size of the Linked List: Calculate the number of elements in the list.

Usage

You can use this code to create a singly linked list, insert elements, perform various operations, and retrieve information about the list.

Perform operations on the list, such as printing, deleting, updating, and more

Example test cases and expected outputs are provided in the test.py code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages