Linked List

A linked list is a linear data structure that consists of nodes. Each Node contains a data field and a pointer to the next Node. In Linked List, unlike arrays, elements are not stored at contiguous memory locations but rather at different memory locations. The various elements in a linked list are linked together using pointers. There are majorly two types of Linked list: Singly Linked List and Doubly Linked List. This category contains all the information you need to know about Linked Lists.

Why is Quick Sort preferred for Arrays and Merge Sort for Linked Lists?

By Mehak Goel

● Published At Dec 2021

This article will explain the major reasons behind using quick sort for arrays and merge sort for linked lists.
... Keep reading ..

Application of Linked List Data Structure

By Firdausia Fatima

● Published At Jan 2022

In this blog, we will explore the application of linked list data structure.... Keep reading ..

Linked List remove() Method in Java

By Firdausia Fatima

● Published At Jan 2022

In this blog, we will discuss three variations of the linked list remove method in Java.... Keep reading ..

Quicksort on a Singly Linked List

By Yogesh Kumar

● Published At Apr 2022

This article will discuss one of the essential sorting algorithms- Quicksort on a singly linked list. We will look at its basic concepts, definitions, algorithms, and implementation in Java.
... Keep reading ..

How to Convert all LinkedHashMap Values to a List in Java

By Riya

● Published At Jan 2022

This article will discuss how we can convert all LinkedHashMap values to a list in java.... Keep reading ..

Difference between a singly linked list and a doubly linked list

By Ishita Chawla

● Published At Dec 2021

This blog will discuss the differences between a singly linked list and a doubly linked list.
... Keep reading ..

Introduction

The linked list is a type of linear data structure formed by interconnected nodes. These nodes are linked to each other using pointers such that each node contains a pointer to its next node. Unlike arrays, the nodes in the linked list are stored in random memory locations. The first node of the linked list is called the head of the linked list, and the last node is called the tail of the linked list. The next pointer of the tail of the linked list points to a null pointer. On the basis of the linkage between the nodes of the linked list, the linked list can be of three types- Singly-linked list- It contains interconnected nodes, where each node contains some data and a pointer to the next node. It can only be traversed in one direction. Doubly linked list- It contains nodes that contain data and two pointers, a pointer to the previous node and the pointer to the next node. It allows us to traverse the linked list in both the forward and backward directions. Circular linked list- A linked list in which the next pointer of the tail points to the head of the linked list is known as a cyclic linked list.

Create Linked List From A Given Array

By Malay Gain

● Published At Nov 2021

In this article, we will learn how to create a linked list from a given array.... Keep reading ..

Binary search on Linked List

By Yukti Kumari

● Published At Nov 2021

This article deals with the algorithm to perform binary search on a linked list and explains the time and space complexity.
... Keep reading ..

Insert a node at a specific position in a linked list

By Urwashi Priya

● Published At Nov 2021

This article will brief you on how to insert a node at a specific position in a linked list.
... Keep reading ..

Deletion of a linked list

By Shreya Deep

● Published At Nov 2021

In this article, we’ll learn how to delete a linked list
... Keep reading ..

Unrolled linked list

By Shreya Deep

● Published At Jan 2022

In this article, you’ll be introduced to an unrolled linked list.... Keep reading ..

Implementing a Linked List in Java Using Class

By Ishita Chawla

● Published At Dec 2021

This blog will discuss implementing a linked list in Java using Class.... Keep reading ..

LinkedList descendingIterator in Java

By Saksham Gupta

● Published At Jan 2022

In this blog, we will discuss Linked List iterators and see the LinkedList descendingIterator in detail. ... Keep reading ..

Construct a Linked List from a 2D Matrix

By Malay Gain

● Published At Jan 2022

In this article, we will learn how to construct a linked list from a 2D matrix in an iterative approach.... Keep reading ..

Advantages and Disadvantages of LinkedList

By Nishant Rana

● Published At Jan 2022

This blog will cover the Advantages and Disadvantages of LinkedList.
... Keep reading ..

LinkedList implementation in JavaScript

By Dhruv Sharma

● Published At Dec 2021

In this article, we will look at implementing one of the most frequently used data structures, i.e. LinkedList in Javascript.... Keep reading ..

Is it possible to reverse a linked list in less than O(n)?

By Reet Maggo

● Published At Nov 2021

This article will explain the minimum time possible to reverse a linked list.... Keep reading ..

How to write the functions that modify the head pointer of a Linked List in C?

By Malay Gain

● Published At Nov 2021

In this article, we will learn how to modify the head pointer of a Linked List
... Keep reading ..

Generic Linked List in C

By Malay Gain

● Published At Nov 2021

In this article, we will learn how to implement Generic Linked List in C.
... Keep reading ..

LinkedList listIterator() method in Java

By Priyanka Patwal

● Published At Nov 2021

In this article we will discuss the LinkedList listIterator method in Java.
... Keep reading ..

Java.util.LinkedList.offer(), offerFirst(), offerLast() in Java

By Soumya Agrawal

● Published At Nov 2021

In this article, we will discuss the special functions of the LinkedList class in java.... Keep reading ..

Retrieving Value from a LinkedHashMap by Index in Java

By dhruv sharma

● Published At Nov 2021

In this article, we will discuss how to get value from a LinkedHashMap by index in Java.... Keep reading ..

LinkedList removeFirst method in Java

By Soumya Agrawal

● Published At Nov 2021

In this article, we will cover the LinkedList method in Java to optimize the code.
... Keep reading ..

LinkedList add() method in Java

By Nishant Rana

● Published At Jan 2022

This blog will cover the famous method of LinkedList add() method in Java.
... Keep reading ..

LinkedList addAll() method in Java

By Nishant Rana

● Published At Jan 2022

This blog will cover the famous method of LinkedList i.e., addAll() method in Java.
... Keep reading ..

Reverse a Linked List in Groups

By aniket verma

● Published At Apr 2022

This article revolves around how to reverse a linked list in groups in the C++ Programming language using the brute force approach and the most optimal solution.... Keep reading ..

Circular Linked List

A linked list in which the next pointer of the tail points to the head of the linked list is known as a cyclic linked list. This enables us to start the traversal for the whole linked list from any node. A circular linked list can be a singly circular linked list a doubly circular linked list. The idea of a circular linked list is generally used for the cases when the entries are arranged circularly. For example, these are used in the Round Robin scheduling algorithm for processors and in the time-sharing applications where the operating system has to execute the task alternatively in a circular manner until all the tasks are completed.

Singly Linked List To Circular Linked List

By Ishita Chawla

● Published At Dec 2021

This blog will discuss how to convert a singly linked list to a circular linked list.... Keep reading ..

Check If A Linked List Is Circular Linked List

By Nishant Rana

● Published At Feb 2022

This blog will cover the problem of checking if LinkedList is a Circular LinkedList.
... Keep reading ..

Circular Linked List Traversal

By Firdausia Fatima

● Published At Jan 2022

In this blog, we’ll explore various techniques to traverse a circular linked list.
... Keep reading ..

Doubly Linked List

Ever wondered what if we wanted to travel both ways in a linked list, then how is it possible? Easy-peasy, just like the next node reference in singly-linked lists add a previous node reference too and yes, this is what doubly linked lists are. Doubly linked lists make our jobs really easy when both front and back navigations are required. Can you think of any of its applications? Think of a browser for forwarding and backward web pages navigation. Besides this, it is also used for undo and redo functionality. Now since you know why doubly-linked lists you must study doubly-linked lists.

Convert a given Binary Tree to Doubly Linked List

By Ishita Chawla

● Published At Dec 2021

This blog will discuss how to convert a given binary tree to doubly linked list using 3 different approaches.... Keep reading ..

Reverse a Doubly-Linked List in Given Size

By Firdausia Fatima

● Published At Jan 2022

In this blog, we’ll solve the problem reverse a doubly-linked list in groups of size K by two different methods.... Keep reading ..

QuickSort on a Doubly Linked List

By GAZAL ARORA

● Published At Dec 2021

In this blog, you will learn to implement QuickSort on a Doubly Linked List.
... Keep reading ..

Memory-efficient doubly linked list

By Sandeep kamila

● Published At Nov 2021

This blog will cover the Memory-efficient doubly linked list with its implementation in C++.... Keep reading ..

Binary Tree to Doubly Linked List

By Aditya Narayan Joardar

● Published At Nov 2021

In this article, we will discuss how to convert a binary tree into a doubly-linked list using in-order traversal.... Keep reading ..

Doubly Linked List From 2D Matrix

By Aditya Narayan Joardar

● Published At Nov 2021

In this article, we will discuss how to construct a doubly-linked list from a 2D matrix with the help of various examples and explanations.... Keep reading ..

Rotate Doubly Linked List by N nodes

By Riya

● Published At Feb 2022

This article will discuss the problem “Rotate doubly linked list by N nodes”, approaches to solve this problem, and C++ implementation of the solution... Keep reading ..

Check if a doubly-linked list of characters is a palindrome or not

By Shreya Deep

● Published At Nov 2021

In this article, we’ll learn to find if a doubly-linked list of characters is a palindrome or not.... Keep reading ..

The Merge Sort for Doubly Linked List

By Saksham Gupta

● Published At Jan 2022

In this blog, we will see how we can apply one of the most famous sorting algorithms, i.e., merge sort on a doubly linked list.
... Keep reading ..

Advantages, Disadvantages And Uses Of a Doubly Linked List

By Yukti Kumari

● Published At Nov 2021

This article explains the advantages, disadvantages as well as uses of doubly-linked lists. ... Keep reading ..

How to find the largest element of a doubly-linked list

By Gorakhnath yadav

● Published At Nov 2021

this blog discusses how we can find the largest element of a doubly-linked list. Read more to learn the solution and its implementation in detail.
... Keep reading ..

Bubble Sort on Doubly Linked List

By Yogesh Kumar

● Published At Nov 2021

In this blog, we will understand the sorting technique using one of the used data structures called Linked List, with its descriptive type called Doubly Linked List.... Keep reading ..

Reverse the Doubly Linked List

By Yogesh Kumar

● Published At Nov 2021

In this blog, we will discuss the concept of reversing the doubly Linked list.... Keep reading ..

Extract Leaves of a Binary Tree in a Doubly Linked List

By Saksham Gupta

● Published At Jan 2022

In this blog, we will look at an interesting fusion of a binary tree and linked list via a famous interview question, i.e., Extract Leaves of a Binary Tree in a Doubly Linked List.... Keep reading ..

Problems

In technical interviews and competitive programming contests, problems related to linked lists are frequently asked. A beginner might find it challenging to solve these problems initially. This section will cover the commonly asked questions in programming interviews of product-based companies.

Insertion Sort for Singly Linked List

By dhruv sharma

● Published At Nov 2021

In this blog, we will look at how one can use the idea of insertion sort for also sorting singly-linked lists.... Keep reading ..

Program to convert ArrayList to LinkedList in Java

By Juhi Sinha

● Published At Nov 2021

In this blog, we will be discussing different methods to convert an ArrayList to LinkedList in java.
... Keep reading ..

Python Program to Reverse a linked list

By Soumya Agrawal

● Published At Nov 2021

In this blog, we will see how to reverse a linked list using the python language.
... Keep reading ..

Java Program to Reverse a Linked List

By Nishant Rana

● Published At Jan 2022

This blog will cover the question to reverse the Linked List and discuss its Time and Space complexity.
... Keep reading ..

Bubble Sort For Linked List By Swapping Nodes

By Rhythm Jain

● Published At Nov 2021

This article discusses the Problem, Bubble Sort For Linked List By Swapping Nodes. ... Keep reading ..

LRU Cache Implementation

By vaishnavi pandey

● Published At Oct 2021

In this article, we’ll be seeing the implementation of the LRU cache. LRU is an important data structure.... Keep reading ..

Sort a Linked List

By Husen Kagdi

● Published At Dec 2021

In this blog, we will learn how to apply sorting techniques like Bubble sort and merge sort on a linked list.
... Keep reading ..

Remove Duplicates from a Sorted Linked List.

By Saksham Gupta

● Published At Jan 2022

In this blog, we will discuss one of the most asked questions in FAANG and other dream company’s interviews, i.e., remove duplicates from a sorted linked list.
... Keep reading ..

Merge one Linked List into another at alternate positions

By Urwashi Priya

● Published At Jan 2022

This article will brief you on how to Merge one Linked List into another at alternate positions.
... Keep reading ..

Multiplication of two polynomials using Linked List

By Yukti Kumari

● Published At Nov 2021

This article explains the process of multiplication of two polynomials using a linked list along with its code implementation and examples.... Keep reading ..

Count pairs from two linked lists whose sum is equal to a given value

By Ayush Tiwari

● Published At Nov 2021

This article will brief you to count pairs from two linked lists whose sum is equal to a given value.... Keep reading ..

Sort a Linked List of 0s,1s, and 2s

By Vibhor Bhatnagar

● Published At Nov 2021

This article will brief you on how to Sort a linked list of 0s,1s, and 2s.
... Keep reading ..

How to remove duplicates from the sorted linked list

By Gorakhnath yadav

● Published At Nov 2021

This blog discussed the methods to remove duplicates from the sorted linked lists. Read the blog to learn these methods in detail.
... Keep reading ..

Find the sum of last N node of given Linked List

By Yogesh Kumar

● Published At Nov 2021

This blog will solve the one problem of a linked list for finding the sum of the last n nodes given a linked list.... Keep reading ..

First Node Loop in LinkedList

By Yogesh Kumar

● Published At Nov 2021

In this blog, we will discuss one of the essential Data Structures, i.e., Linked List. We are going to understand it with the help of one of the problem First Node Loop in LinkedList.... Keep reading ..

Merge K sorted linked lists

By Urwashi Priya

● Published At Dec 2021

This article will brief you on how to Merge K sorted linked lists.
... Keep reading ..

Sublist Search (Search a linked list in another list)

By Sandeep kamila

● Published At Nov 2021

This blog will cover the approach of searching a linked list in another list with its explanation and code in C++.... Keep reading ..

Union and Intersection of two Linked Lists

By Harsh Goyal

● Published At Nov 2021

This article will discuss the Union and Intersection of two Linked Lists and various ways to solve this problem, starting from the brute force approach to the efficient approach... Keep reading ..

Reverse a Linked List recursively

By Urwashi Priya

● Published At Dec 2021

This article will brief you on how to Recursively reverse a Linked List.... Keep reading ..

Delete nodes that have a greater value on the right side in the linked list

By Ayush Tiwari

● Published At Nov 2021

This article will brief you on how to delete all nodes with a greater value on the right side.... Keep reading ..

Make a loop at the K-Th position in the Linked list

By Sandeep kamila

● Published At Nov 2021

This blog will cover the approach of making a loop at the K-th position in the linked list with a complete explanation and its C++ code.... Keep reading ..

Identical Linked Lists

By Vibhor Bhatnagar

● Published At Nov 2021

This article will brief you on how to check Identical Linked Lists.
... Keep reading ..

Count duplicates in circular linked list

By SHIKHAR SONI

● Published At Jan 2022

The blog aims to find the count of duplicate elements in a circular linked list and explain the solution process.... Keep reading ..

Remove Duplicates from a Sorted Doubly Linked List

By Yogesh Kumar

● Published At Nov 2021

In this blog, we will discuss the concept of a doubly-linked list, using the Remove the duplicates from the list, in a generalized manner with a detailed explanation.
... Keep reading ..

Remove Duplicates From An Unsorted Linked List

By Harsh Goyal

● Published At Nov 2021

This article will discuss the Remove duplicates from an unsorted linked list problem and various ways to solve this problem, from the brute force approach to the efficient approach... Keep reading ..

Delete all occurrences of a given key

By Yogesh Kumar

● Published At Nov 2021

In this blog, we will understand the concept of Doubly Linked List and solve the problem.
... Keep reading ..

How to remove duplicates from an unsorted doubly linked list

By Gorakhnath yadav

● Published At Nov 2021

This blog discussed the methods to remove duplicates from an unsorted doubly linked list. Read the blog to learn these methods in detail... Keep reading ..

Remove Every Kth Node Of The Linked List

By Harsh Goyal

● Published At Nov 2021

This article will discuss the Remove every Kth node of the linked list problem and various ways to solve this problem, from the brute force approach to the efficient approach.
... Keep reading ..

Merge a linked list into another linked list at alternate positions

By Alisha Chhabra

● Published At Nov 2021

This article covers the approach to merge a linked list into another linked list at alternate positions.
... Keep reading ..

How to swap Kth node from the beginning with Kth node from the end in the given Singly Linked List

By Gorakhnath yadav

● Published At Nov 2021

In this blog, We learned to swap Kth node from the beginning with Kth node from the end in the given singly Linked List. Read further for a detailed solution.... Keep reading ..

Count duplicates in a Linked list

By Aman Chourasiya

● Published At Nov 2021

In this blog, we will discuss a problem based on the Linked list data structure. Linked lists are very common data structures which do not place elements in a contiguous memory location, unlike arrays.... Keep reading ..

Print Reverse Of A Linked List Without Actually Reversing it

By Alisha Chhabra

● Published At Nov 2021

This article covers the approach to print reverse of a linked list without actually Reversing it. ... Keep reading ..

Reverse alternate K nodes in a Singly Linked List

By Harsh Goyal

● Published At Dec 2021

This article will discuss the Reverse alternate K nodes in a Singly Linked List problem and various ways to solve this problem, starting from the brute force approach to the efficient approach.... Keep reading ..

Length of the most extended palindrome list in a linked list using O(1) extra space

By Urwashi Priya

● Published At Dec 2021

This article will brief you on how to find the Length of the most extended palindrome list in a linked list using O(1) extra space.
... Keep reading ..

Convert A String To A Singly Linked List

By Malay Gain

● Published At Jan 2022

In this article, we will learn how to convert a string to a singly Linked List
... Keep reading ..

Sort a Linked List that is Sorted Alternating Ascending and Descending Orders

By Saksham Gupta

● Published At Jan 2022

In this blog, we will see an interesting application of sorting on linked list via question, sort a linked list that is sorted alternating ascending and descending order.
... Keep reading ..

Largest and Smallest Element in a Singly Linked List

By Riya

● Published At Jan 2022

This article will discuss the problem of finding the “Largest and Smallest Element in a Singly Linked List”, an approach to solve this problem and the C++ implementation of the solution.... Keep reading ..

Rearrange a linked list such that all even and odd positioned nodes are together

By Ishita Chawla

● Published At Dec 2021

This blog will discuss how to rearrange a linked list such that all even and odd positioned nodes are together.
... Keep reading ..

Partitioning a linked list around a given value and keeping the original order

By Riya

● Published At Jan 2022

This article will discuss the problem “Partitioning a linked list around a given value and keeping the original order”, approaches to solve this problem, and C++ implementation of the solution.... Keep reading ..

Pairwise Swap Elements of a Singly Linked List

By Riya

● Published At Jan 2022

This article will discuss the problem “Pairwise Swap Elements of a Singly Linked List”, recursive and iterative approaches to solve this problem, and the C++ implementation of the approaches.... Keep reading ..

Pairwise swap adjacent nodes of a Linked list by changing pointers

By GAZAL ARORA

● Published At Dec 2021

In this blog, you will learn how to do a pairwise swap of adjacent nodes in a Linked List by changing node’s pointers.... Keep reading ..

Pairwise swap elements of a given linked list by changing links

By Nishant Rana

● Published At Jan 2022

This blog will cover the question of Pairwise swap elements of a given linked list by changing links and discussing its Time and Space complexity.... Keep reading ..

Reversing a Linked List

By Pranav Gautam

● Published At Dec 2021

Learn to create a reversed linked list from the given linked list.... Keep reading ..

Add two numbers represented by the linked lists | Part-1

By Gorakhnath yadav

● Published At Nov 2021

We learned about the different methods to add two numbers represented by the linked lists in this blog. Read further to learn about these methods in detail.... Keep reading ..

Add two numbers represented by the linked lists | Part-2

By Gorakhnath yadav

● Published At Nov 2021

In this blog, we learned about the stack-based approach to add two numbers represented by the linked lists. Read further to learn about these methods in detail.... Keep reading ..

Add two numbers represented by the linked lists | Part-3

By Gorakhnath yadav

● Published At Nov 2021

This blog discusses a space-efficient approach to add two numbers represented by the linked lists. Read the complete blog for the detailed solution.
... Keep reading ..

Design Browser History

By Aditya Narayan Joardar

● Published At Feb 2022

This article discusses the Design Browser History problem asked in a few competitive coding platforms.... Keep reading ..

Design Browser History (Doubly linked list)

By HET FADIA

● Published At Jan 2022

The blog uses a Doubly-linked list data structure to design browser history.... Keep reading ..

Clone a linked list with next and random pointer

By Yukti Kumari

● Published At Jan 2022

This article discusses the solution and various approaches to solving the problem - Clone a Linked List with next and random pointer. It also explains in detail the time and space complexities of each approach.... Keep reading ..

Detect a Loop in a Linked List

By Neelakshi Lahiri

● Published At Jan 2022

A common coding question is to detect loop in a linked list. This article discusses the different methods to solve this problem.... Keep reading ..

Length of the loop in the linked list

By Vaishnavi Pandey

● Published At Jan 2022

In this article, we'll go through how to find the length of the loop in the linked list, which is one of the frequently asked questions in interviews.
... Keep reading ..

Rotate a Linked List

By Pranchal Agrahari

● Published At Jan 2022

In this article, we will discuss a popular interview question Rotate a linked list with detailed explanations and code in C++.
... Keep reading ..

Swap Nodes in Pairs

By Alisha Chhabra

● Published At Nov 2021

This article covers the approach and Implementation in C++ and Java on how to Swap Nodes in Pairs.
... Keep reading ..

Find the Minimum and Maximum Number of Nodes Between Critical Points

By Pranav Gautam

● Published At Dec 2021

Learn to find the minimum and the maximum number of nodes in a linked list between any two critical points.... Keep reading ..

## Top Problems related to Linked List

MergeSort Linked List

Print Reverse LinkedList

Delete Alternate Nodes

Delete a Node from Linked List

Find a Node in Linked List

Cycle Detection in a Singly Linked List

Detect and Remove Loop

Deletion In Circular Linked List

Intersection of Linked List

Sum Between Zeroes

Implement Stack With Linked List

MergeSort Linked List

Delete N nodes after M nodes of a linked list

Reverse Alternate Nodes of a Singly Linked List

Add First and Second Half

Add First and Second Reversed Half

Find Pairs

Pair Swap

Remove String

Match Number

Add K Nodes