Skip to main content

Medium DLL ✔

  1. Delete All Occurrences
    1. 05 April, 2026: 00.12.52 ✔
      • Remember, its doubly linked list
      • It may need to preserve next pointer
      • Try to solve with only one pointer(current)
  2. Find Pairs with Given Sum
    • To get the last node, no need to iterate to last node, it can be accessed by last->next
    • As array are sorted, ending condition of comparison iteration could be first->data < last->data
  3. Remove Duplicates
    1. 05 April, 2026: 00.27.23 ❌
      • Failed at optimization(tradeoff)
        • Add item to new list only when there is duplicates, not every time