90% of the Linked List questions on linked list classified into Types
Anonymous User
8894

Linked List

https://leetcode.com/problems/design-linked-list/

Normal Recursion(Given 1 LL)

  1. Simple Recursion Nothing else

    1. https://leetcode.com/problems/swapping-nodes-in-a-linked-list/
    2. https://leetcode.com/problems/plus-one-linked-list/
    3. https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer/
  2. Modifying the LL But the number of Nodes will be same

    1. Reversing the Linked List
      1. https://leetcode.com/problems/reverse-linked-list/
      2. https://leetcode.com/problems/reverse-linked-list-ii/
      3. https://leetcode.com/problems/palindrome-linked-list/
      4. https://leetcode.com/problems/reverse-nodes-in-k-group/
      5. https://leetcode.com/problems/print-immutable-linked-list-in-reverse/
    2. Reordering the Nodes
      1. https://leetcode.com/problems/partition-list/ - IMP
      2. https://leetcode.com/problems/reorder-list/
      3. https://leetcode.com/problems/swap-nodes-in-pairs/
      4. https://leetcode.com/problems/rotate-list/
      5. https://leetcode.com/problems/odd-even-linked-list/
  3. Delete Nodes

    1. https://leetcode.com/problems/remove-nth-node-from-end-of-list/
    2. https://leetcode.com/problems/remove-duplicates-from-sorted-list/ - if asked to remove duplicates from unsorted list then Use HashMap. (Q in HashMap section)
    3. https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/
    4. https://leetcode.com/problems/remove-linked-list-elements/
  4. Insert Node
    1.https://leetcode.com/problems/insert-into-a-sorted-circular-linked-list

Given 2 or more LL

  1. https://leetcode.com/problems/add-two-numbers/
  2. https://leetcode.com/problems/add-two-numbers-ii
  3. https://leetcode.com/problems/merge-two-sorted-lists/
  4. https://leetcode.com/problems/merge-k-sorted-lists/ - IMP
  5. https://leetcode.com/problems/intersection-of-two-linked-lists/
  6. https://leetcode.com/problems/add-two-polynomials-represented-as-linked-lists/

Fast Pointer Slow Pointer(Cycle or middle ele)

  1. https://leetcode.com/problems/linked-list-cycle/
  2. https://leetcode.com/problems/middle-of-the-linked-list/
  3. https://leetcode.com/problems/delete-the-middle-node-of-a-linked-list/
  4. https://leetcode.com/problems/linked-list-cycle-ii/

Hash Table

  1. https://leetcode.com/problems/copy-list-with-random-pointer/ - IMP
  2. https://leetcode.com/problems/remove-duplicates-from-an-unsorted-linked-list/ - If asked in sorted then no need of hash table.

Design Some data struct using LL

  1. https://leetcode.com/problems/lru-cache/
  2. https://leetcode.com/problems/design-hashmap/
  3. https://leetcode.com/problems/max-stack/
  4. https://leetcode.com/problems/design-hashset/
  5. https://leetcode.com/problems/design-browser-history - stk
  6. https://leetcode.com/problems/design-twitter - no need of LL
  7. https://leetcode.com/problems/design-circular-queue

Murge Sort on List

  1. https://leetcode.com/problems/sort-list/

LL + Tree Q's

  1. https://leetcode.com/problems/convert-binary-search-tree-to-sorted-doubly-linked-list/
  2. https://leetcode.com/problems/flatten-a-multilevel-doubly-linked-list/

https://leetcode.com/problems/maximum-twin-sum-of-a-linked-list/
https://leetcode.com/problems/delete-node-in-a-linked-list/

To Do :

https://leetcode.com/problems/all-oone-data-structure
https://leetcode.com/problems/lfu-cache
https://leetcode.com/problems/design-a-text-editor

Comments (5)