Get FREE domain for 1st year and build your brand new site In this article, we have listed important Problems on Linked Lists which you must practice for Coding Interviews and listed introductory and background topics on Linked Lists as well. You must bookmark this page and practice all problems listed. Table of Contents: Following is the list of Linked List Problems: Basic operations in a Linked List: These are the types of Linked Lists that are used in practice: Some extra Introductory topics: These are Practice Coding Problems on Linked List which you must learn and practice to ace all problems in your Coding Interview at companies like Google [click on the topic to go to the respective article where the solution is explained in depth with implementation]: With this article at OpenGenus and the practice of all the topics mentioned, you must have a very strong hold on Linked Lists and will be able to crack any problem.
A linked list is a linear data structure where each element is a separate object.
Linked list elements are not stored at contiguous location; the elements are linked using pointers.
Each node of a list is made up of two items - the data and a reference to the next node. The last node has a reference to null. The entry point into a linked list is called the head of the list. It should be noted that head is not a separate node, but the reference to the first node. If the list is empty then the head is a null reference.
Linked List Representation
// Linked list example in C/C++ // A linked list node struct ListNode { int val; struct ListNode *next; };
// Linked list example in Java // Linked list class class ListNode { // head of list Node head; // Node class class Node { int val; Node next; // Constructor to create a new node Node[int v] { val = v; } } }
# Linked list example in Python # Node class class Node: # Function to initialize the node object def __init__[self, v]: self.val = v # Assign value self.next = None # Initialize next as null # Linked List class class ListNode: # Function to initialize the Linked List def __init__[self]: self.head = None
Practice Problems on Linked List
Recent Articles on Linked List
A linked list is a linear data structure, in which the elements are not stored at contiguous memory locations. The elements in a linked list are linked using pointers as shown in the below image:
In simple words, a linked list consists of nodes where each node contains a data field and a reference[link] to the next node in the list.
Topics :
- Singly Linked List
- Circular Linked List
- Doubly Linked List
Singly Linked List :
More >>
Circular Linked List :
More >>
Doubly Linked List :
More >>
Misc :
Quick Links :
If you still need more assistance with your placement preparation, have a look at our Complete Interview Preparation Course. The course has been designed by our expert mentors to help students crack the coding interview of top product or service-based organizations . You get access to premium lectures, 200+ coding questions bank, resume building tips, and lifetime access to the course content. So to make sure that your next programming interview doesn’t feel like an interrogation, enroll in Complete Interview Preparation and give a boost to your placement preparation.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Doubly Linked List
- Last Updated : 25 May, 2018
Recent articles on Doubly Linked List
- Doubly Linked List Introduction and Insertion
- Delete a node in a Doubly Linked List
- Reverse a Doubly Linked List
- The Great Tree-List Recursion Problem.
- Copy a linked list with next and arbit pointer
- QuickSort on Doubly Linked List
- Swap Kth node from beginning with Kth node from end in a Linked List
- Merge Sort for Doubly Linked List
- Create a Doubly Linked List from a Ternary Tree
- Find pairs with given sum in doubly linked list
- Insert value in sorted way in a sorted doubly linked list
- Delete a Doubly Linked List node at a given position
- Count triplets in a sorted doubly linked list whose sum is equal to a given value x
- Remove duplicates from a sorted doubly linked list
- Delete all occurrences of a given key in a doubly linked list
- Remove duplicates from an unsorted doubly linked list
- Sort the biotonic doubly linked list
- Sort a k sorted doubly linked list
- Convert a given Binary Tree to Doubly Linked List | Set
- Program to find size of Doubly Linked List
- Sorted insert in a doubly linked list with head and tail pointers
- Large number arithmetic using doubly linked list
- Rotate Doubly linked list by N nodes
- Priority Queue using doubly linked list
- Reverse a doubly linked list in groups of given size
- Sorted merge of two sorted doubly circular linked lists
- Reverse a Doubly Linked List
- Find the largest node in Doubly linked list
- Insertion Sort for Doubly Linked List
- Delete a node in a Doubly Linked List
- Memory efficient doubly linked list
- Extract Leaves of a Binary Tree in a Doubly Linked List
- Merge Two Balanced Binary Search Trees
- Convert a Binary Tree into Doubly Linked List in spiral fashion
- Check if a doubly linked list of characters is palindrome or not
- XOR Linked List – A Memory Efficient Doubly Linked List
- Convert a given Binary Tree to Doubly Linked List
Quick Links :
- ‘Practice Problems’ on Linked List
- ‘Videos’ on Linked List
- ‘Quizzes’ on Linked List
- Ask a Question on ‘Linked List’