LeetCode LinkedList Problems
Easy Problemsβ
-
- Problem: Reverse a singly linked list.
- LeetCode ID: 206
-
- Problem: Remove all elements from a linked list of integers that have value val.
- LeetCode ID: 203
-
- Problem: Check if a linked list is a palindrome.
- LeetCode ID: 234
-
- Problem: Merge two sorted linked lists and return it as a new sorted list.
- LeetCode ID: 21
-
- Problem: Determine if a linked list has a cycle.
- LeetCode ID: 141
-
Remove Duplicates from Sorted List
- Problem: Delete all duplicates such that each element appears only once.
- LeetCode ID: 83
-
Intersection of Two Linked Lists
- Problem: Find the node at which the intersection of two singly linked lists begins.
- LeetCode ID: 160
Medium Problemsβ
-
- Problem: Add two numbers represented by linked lists.
- LeetCode ID: 2
-
- Problem: Group all odd nodes together followed by the even nodes.
- LeetCode ID: 328
-
Remove Nth Node From End of List
- Problem: Remove the nth node from the end of the list.
- LeetCode ID: 19
-
- Problem: Reorder the list to follow a specific order.
- LeetCode ID: 143
-
- Problem: Rotate the list to the right by k places.
- LeetCode ID: 61
-
- Problem: Swap every two adjacent nodes.
- LeetCode ID: 24
-
- Problem: Partition the list so that nodes less than x come before nodes greater than or equal to x.
- LeetCode ID: 86
Hard Problemsβ
-
- Problem: Merge k sorted linked lists and return it as one sorted list.
- LeetCode ID: 23
-
- Problem: Reverse the nodes of a linked list k at a time.
- LeetCode ID: 25
-
- Problem: A linked list with a random pointer, deep copy the list.
- LeetCode ID: 138
-
- Problem: Design and implement a data structure for Least Recently Used (LRU) cache.
- LeetCode ID: 146
-
Flatten a Multilevel Doubly Linked List
- Problem: Flatten a multilevel doubly linked list.
- LeetCode ID: 430
-
- Problem: Return a random node's value from the linked list.
- LeetCode ID: 382
Conclusionβ
Practicing these problems will help reinforce the concepts learned and provide practical experience in using linked lists effectively. By solving these problems, you will enhance your problem-solving skills and deepen your understanding of linked list manipulation in various contexts.