Pattern
Linked List
Linked list problems change pointers in place, so draw the nodes and the arrows before you write code. Two pointers at different speeds find middles and loops, and a dummy node removes the special case at the head. Most solutions take O(n) time and O(1) memory.
1. Reverse Linked Listlinked-list · in-placeEasy2. Merge Two Sorted Listslinked list · two pointers · mergeEasy3. Linked List Cyclelinked list · two pointers · cycle detectionEasy4. Reorder Listlinked list · two pointers · in placeMed.5. Remove Nth Node From End of Listlinked list · two pointers · dummy nodeMed.6. Copy List With Random Pointerlinked list · hash map · deep copyMed.7. Add Two Numberslinked list · math · carryMed.8. Find the Duplicate Numberarray · two pointers · cycle detectionMed.9. LRU Cachedesign · cacheMed.10. Merge K Sorted Listslinked-list · sortingHard11. Reverse Nodes In K Grouplinked list · reversal · in placeHard