Skip to main content

LeetCode LinkedList Problems

Easy Problems​

  1. Reverse Linked List

    • Problem: Reverse a singly linked list.
    • LeetCode ID: 206
  2. Remove Linked List Elements

    • Problem: Remove all elements from a linked list of integers that have value val.
    • LeetCode ID: 203
  3. Palindrome Linked List

    • Problem: Check if a linked list is a palindrome.
    • LeetCode ID: 234
  4. Merge Two Sorted Lists

    • Problem: Merge two sorted linked lists and return it as a new sorted list.
    • LeetCode ID: 21
  5. Linked List Cycle

    • Problem: Determine if a linked list has a cycle.
    • LeetCode ID: 141
  6. Remove Duplicates from Sorted List

    • Problem: Delete all duplicates such that each element appears only once.
    • LeetCode ID: 83
  7. Intersection of Two Linked Lists

    • Problem: Find the node at which the intersection of two singly linked lists begins.
    • LeetCode ID: 160

Medium Problems​

  1. Add Two Numbers

    • Problem: Add two numbers represented by linked lists.
    • LeetCode ID: 2
  2. Odd Even Linked List

    • Problem: Group all odd nodes together followed by the even nodes.
    • LeetCode ID: 328
  3. Remove Nth Node From End of List

    • Problem: Remove the nth node from the end of the list.
    • LeetCode ID: 19
  4. Reorder List

    • Problem: Reorder the list to follow a specific order.
    • LeetCode ID: 143
  5. Rotate List

    • Problem: Rotate the list to the right by k places.
    • LeetCode ID: 61
  6. Swap Nodes in Pairs

    • Problem: Swap every two adjacent nodes.
    • LeetCode ID: 24
  7. Partition List

    • Problem: Partition the list so that nodes less than x come before nodes greater than or equal to x.
    • LeetCode ID: 86

Hard Problems​

  1. Merge k Sorted Lists

    • Problem: Merge k sorted linked lists and return it as one sorted list.
    • LeetCode ID: 23
  2. Reverse Nodes in k-Group

    • Problem: Reverse the nodes of a linked list k at a time.
    • LeetCode ID: 25
  3. Copy List with Random Pointer

    • Problem: A linked list with a random pointer, deep copy the list.
    • LeetCode ID: 138
  4. LRU Cache

    • Problem: Design and implement a data structure for Least Recently Used (LRU) cache.
    • LeetCode ID: 146
  5. Flatten a Multilevel Doubly Linked List

    • Problem: Flatten a multilevel doubly linked list.
    • LeetCode ID: 430
  6. Linked List Random Node

    • 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.