Linked List Problems
Master linked list problems with AI-powered solutions. Get instant coding assistance during your technical interviews for all 62 problems in this category.
Total Problems: 62
Easy: 11
Medium: 45
Hard: 6
Showing 50 of 62 problems
Problems
Scroll within this area to browse all problems
#
Title
Difficulty
Linked List LeetCode Problems List
- 206. Reverse Linked List - Easy - Linked ListGiven the head of a singly linked list, reverse the list, and return the reversed list.... Topics: Linked List, Recursion
- 146. LRU Cache - Medium - Linked ListDesign a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the LRUCache class: LRUCache(int capacity) Initia... Topics: Hash Table, Linked List, Design, Doubly-Linked List
- 21. Merge Two Sorted Lists - Easy - Linked ListYou are given the heads of two sorted linked lists list1 and list2. Merge the two lists into one sorted list. The list should be made by splicing toge... Topics: Linked List, Recursion
- 141. Linked List Cycle - Easy - Linked ListGiven head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if there is some node in the ... Topics: Hash Table, Linked List, Two Pointers
- 23. Merge k Sorted Lists - Hard - Linked ListYou are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list ... Topics: Linked List, Divide and Conquer, Heap (Priority Queue), Merge Sort
- 460. LFU Cache - Hard - Linked ListDesign and implement a data structure for a Least Frequently Used (LFU) cache. Implement the LFUCache class: LFUCache(int capacity) Initializes the ob... Topics: Hash Table, Linked List, Design, Doubly-Linked List
- 19. Remove Nth Node From End of List - Medium - Linked ListGiven the head of a linked list, remove the nth node from the end of the list and return its head.... Topics: Linked List, Two Pointers
- 138. Copy List with Random Pointer - Medium - Linked ListA linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null. Cons... Topics: Hash Table, Linked List
- 234. Palindrome Linked List - Easy - Linked ListGiven the head of a singly linked list, return true if it is a palindrome or false otherwise.... Topics: Linked List, Two Pointers, Stack, Recursion
- 25. Reverse Nodes in k-Group - Hard - Linked ListGiven the head of a linked list, reverse the nodes of the list k at a time, and return the modified list. k is a positive integer and is less than or ... Topics: Linked List, Recursion
- 83. Remove Duplicates from Sorted List - Easy - Linked ListGiven the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well.... Topics: Linked List
- 114. Flatten Binary Tree to Linked List - Medium - Linked ListGiven the root of a binary tree, flatten the tree into a "linked list": The "linked list" should use the same TreeNode class where the right child poi... Topics: Linked List, Stack, Tree, Depth-First Search, Binary Tree
- 160. Intersection of Two Linked Lists - Easy - Linked ListGiven the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersec... Topics: Hash Table, Linked List, Two Pointers
- 148. Sort List - Medium - Linked ListGiven the head of a linked list, return the list after sorting it in ascending order.... Topics: Linked List, Two Pointers, Divide and Conquer, Sorting, Merge Sort
- 355. Design Twitter - Medium - Linked ListDesign a simplified version of Twitter where users can post tweets, follow/unfollow another user, and is able to see the 10 most recent tweets in the ... Topics: Hash Table, Linked List, Design, Heap (Priority Queue)
- 2. Add Two Numbers - Medium - Linked ListYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes conta... Topics: Linked List, Math, Recursion
- 92. Reverse Linked List II - Medium - Linked ListGiven the head of a singly linked list and two integers left and right where left <= right, reverse the nodes of the list from position left to positi... Topics: Linked List
- 817. Design HashMap - Easy - Linked ListDesign a HashMap without using any built-in hash table libraries. Implement the MyHashMap class: MyHashMap() initializes the object with an empty map.... Topics: Array, Hash Table, Linked List, Design, Hash Function
- 908. Middle of the Linked List - Easy - Linked ListGiven the head of a singly linked list, return the middle node of the linked list. If there are two middle nodes, return the second middle node.... Topics: Linked List, Two Pointers
- 838. Design Linked List - Medium - Linked ListDesign your implementation of the linked list. You can choose to use a singly or doubly linked list. A node in a singly linked list should have two at... Topics: Linked List, Design
- 143. Reorder List - Medium - Linked ListYou are given the head of a singly linked-list. The list can be represented as: L0 → L1 → … → Ln - 1 → Ln Reorder the list to be on the following form... Topics: Linked List, Two Pointers, Stack, Recursion
- 147. Insertion Sort List - Medium - Linked ListGiven the head of a singly linked list, sort the list using insertion sort, and return the sorted list's head. The steps of the insertion sort algorit... Topics: Linked List, Sorting
- 61. Rotate List - Medium - Linked ListGiven the head of a linked list, rotate the list to the right by k places.... Topics: Linked List, Two Pointers
- 860. Design Circular Queue - Medium - Linked ListDesign your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (F... Topics: Array, Linked List, Design, Queue
- 142. Linked List Cycle II - Medium - Linked ListGiven the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if there... Topics: Hash Table, Linked List, Two Pointers
- 82. Remove Duplicates from Sorted List II - Medium - Linked ListGiven the head of a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Return the... Topics: Linked List, Two Pointers
- 116. Populating Next Right Pointers in Each Node - Medium - Linked ListYou are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following defin... Topics: Linked List, Tree, Depth-First Search, Breadth-First Search, Binary Tree
- 1411. Convert Binary Number in a Linked List to Integer - Easy - Linked ListGiven head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the bi... Topics: Linked List, Math
- 86. Partition List - Medium - Linked ListGiven the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should p... Topics: Linked List, Two Pointers
- 528. Swapping Nodes in a Linked List - Medium - Linked ListYou are given the head of a linked list, and an integer k. Return the head of the linked list after swapping the values of the kth node from the begin... Topics: Linked List, Two Pointers
- 328. Odd Even Linked List - Medium - Linked ListGiven the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordere... Topics: Linked List
- 237. Delete Node in a Linked List - Medium - Linked ListThere is a singly-linked list head and we want to delete a node node in it. You are given the node to be deleted node. You will not be given access to... Topics: Linked List
- 2871. Double a Number Represented as a Linked List - Medium - Linked ListYou are given the head of a non-empty linked list representing a non-negative integer without leading zeroes. Return the head of the linked list after... Topics: Linked List, Math, Stack
- 2411. Spiral Matrix IV - Medium - Linked ListYou are given two integers m and n, which represent the dimensions of a matrix. You are also given the head of a linked list of integers. Generate an ... Topics: Array, Linked List, Matrix, Simulation
- 109. Convert Sorted List to Binary Search Tree - Medium - Linked ListGiven the head of a singly linked list where elements are sorted in ascending order, convert it to a height-balanced binary search tree.... Topics: Linked List, Divide and Conquer, Tree, Binary Search Tree, Binary Tree
- 816. Design HashSet - Easy - Linked ListDesign a HashSet without using any built-in hash table libraries. Implement MyHashSet class: void add(key) Inserts the value key into the HashSet. boo... Topics: Array, Hash Table, Linked List, Design, Hash Function
- 859. Design Circular Deque - Medium - Linked ListDesign your implementation of the circular double-ended queue (deque). Implement the MyCircularDeque class: MyCircularDeque(int k) Initializes the deq... Topics: Array, Linked List, Design, Queue
- 766. Flatten a Multilevel Doubly Linked List - Medium - Linked ListYou are given a doubly linked list, which contains nodes that have a next pointer, a previous pointer, and an additional child pointer. This child poi... Topics: Linked List, Depth-First Search, Doubly-Linked List
- 1582. Design Browser History - Medium - Linked ListYou have a browser of one tab where you start on the homepage and you can visit another url, get back in the history number of steps or move forward i... Topics: Array, Linked List, Stack, Design, Doubly-Linked List, Data Stream
- 203. Remove Linked List Elements - Easy - Linked ListGiven the head of a linked list and an integer val, remove all the nodes of the linked list that has Node.val == val, and return the new head.... Topics: Linked List, Recursion
- 2216. Delete the Middle Node of a Linked List - Medium - Linked ListYou are given the head of a linked list. Delete the middle node, and return the head of the modified linked list. The middle node of a linked list of ... Topics: Linked List, Two Pointers
- 24. Swap Nodes in Pairs - Medium - Linked ListGiven a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (i... Topics: Linked List, Recursion
- 1765. Merge In Between Linked Lists - Medium - Linked ListYou are given two linked lists: list1 and list2 of sizes n and m respectively. Remove list1's nodes from the ath node to the bth node, and put list2 i... Topics: Linked List
- 117. Populating Next Right Pointers in Each Node II - Medium - Linked ListGiven a binary tree struct Node { int val; Node *left; Node *right; Node *next; } Populate each next pointer to point to its next right node. If there... Topics: Linked List, Tree, Depth-First Search, Breadth-First Search, Binary Tree
- 725. Split Linked List in Parts - Medium - Linked ListGiven the head of a singly linked list and an integer k, split the linked list into k consecutive linked list parts. The length of each part should be... Topics: Linked List
- 2389. Design a Text Editor - Hard - Linked ListDesign a text editor with a cursor that can do the following: Add text to where the cursor is. Delete text from where the cursor is (simulating the ba... Topics: Linked List, String, Stack, Design, Simulation, Doubly-Linked List
- 1484. Linked List in Binary Tree - Medium - Linked ListGiven a binary tree root and a linked list with head as the first node. Return True if all the elements in the linked list starting from the head corr... Topics: Linked List, Tree, Depth-First Search, Binary Tree
- 2196. Reverse Nodes in Even Length Groups - Medium - Linked ListYou are given the head of a linked list. The nodes in the linked list are sequentially assigned to non-empty groups whose lengths form the sequence of... Topics: Linked List
- 445. Add Two Numbers II - Medium - Linked ListYou are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contai... Topics: Linked List, Math, Stack
- 2182. Find the Minimum and Maximum Number of Nodes Between Critical Points - Medium - Linked ListA critical point in a linked list is defined as either a local maxima or a local minima. A node is a local maxima if the current node has a value stri... Topics: Linked List
- 3501. Delete Nodes From Linked List Present in Array - Medium - Linked ListYou are given an array of integers nums and the head of a linked list. Return the head of the modified linked list after removing all nodes from the l... Topics: Array, Hash Table, Linked List
- 1767. Design Front Middle Back Queue - Medium - Linked ListDesign a queue that supports push and pop operations in the front, middle, and back. Implement the FrontMiddleBack class: FrontMiddleBack() Initialize... Topics: Array, Linked List, Design, Queue, Data Stream
- 2573. Remove Nodes From Linked List - Medium - Linked ListYou are given the head of a linked list. Remove every node which has a node with a greater value anywhere to the right side of it. Return the head of ... Topics: Linked List, Stack, Recursion, Monotonic Stack
- 1905. Design Authentication Manager - Medium - Linked ListThere is an authentication system that works with authentication tokens. For each session, the user will receive a new authentication token that will ... Topics: Hash Table, Linked List, Design, Doubly-Linked List
- 2299. Merge Nodes in Between Zeros - Medium - Linked ListYou are given the head of a linked list, which contains a series of integers separated by 0's. The beginning and end of the linked list will have Node... Topics: Linked List, Simulation
- 432. All O`one Data Structure - Hard - Linked ListDesign a data structure to store the strings' count with the ability to return the strings with minimum and maximum counts. Implement the AllOne class... Topics: Hash Table, Linked List, Design, Doubly-Linked List
- 1072. Next Greater Node In Linked List - Medium - Linked ListYou are given the head of a linked list with n nodes. For each node in the list, find the value of the next greater node. That is, for each node, find... Topics: Array, Linked List, Stack, Monotonic Stack
- 1337. Design Skiplist - Hard - Linked ListDesign a Skiplist without using any built-in libraries. A skiplist is a data structure that takes O(log(n)) time to add, erase and search. Comparing w... Topics: Linked List, Design
- 1267. Remove Zero Sum Consecutive Nodes from Linked List - Medium - Linked ListGiven the head of a linked list, we repeatedly delete consecutive sequences of nodes that sum to 0 until there are no such sequences. After doing so, ... Topics: Hash Table, Linked List
- 382. Linked List Random Node - Medium - Linked ListGiven a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen. Implement the... Topics: Linked List, Math, Reservoir Sampling, Randomized
- 2236. Maximum Twin Sum of a Linked List - Medium - Linked ListIn a linked list of size n, where n is even, the ith node (0-indexed) of the linked list is known as the twin of the (n-1-i)th node, if 0 <= i <= (n /... Topics: Linked List, Two Pointers, Stack
- 2903. Insert Greatest Common Divisors in Linked List - Medium - Linked ListGiven the head of a linked list head, in which each node contains an integer value. Between every pair of adjacent nodes, insert a new node with a val... Topics: Linked List, Math, Number Theory
Related LeetCode Topics
- Array LeetCode Problems
- Backtracking LeetCode Problems
- Biconnected Component LeetCode Problems
- Binary Indexed Tree LeetCode Problems
- Binary Search LeetCode Problems
- Binary Search Tree LeetCode Problems
- Binary Tree LeetCode Problems
- Bit Manipulation LeetCode Problems
- Bitmask LeetCode Problems
- Brainteaser LeetCode Problems
- Breadth-First Search LeetCode Problems
- Bucket Sort LeetCode Problems
- Combinatorics LeetCode Problems
- Concurrency LeetCode Problems
- Counting LeetCode Problems
- Counting Sort LeetCode Problems
- Data Stream LeetCode Problems
- Database LeetCode Problems
- Depth-First Search LeetCode Problems
- Design LeetCode Problems