Skip to content

Latest commit

 

History

History
100 lines (85 loc) · 6.24 KB

File metadata and controls

100 lines (85 loc) · 6.24 KB

Basic

Problem Difficulty
707. Design Linked List Medium

Traversal

Problem Difficulty Notes
2181. Merge Nodes in Between Zeros Medium (1333) Sum values until zero, build new node per segment.
817. Linked List Components Medium (1428) Check next to see if it's the end.
725. Split Linked List in Parts Medium Compute length, distribute remainder one by one.
430. Flatten a Multilevel Doubly Linked List Medium Preorder traversal.

Remove

Problem Difficulty
203. Remove Linked List Elements Easy
237. Delete Node in a Linked List Medium
83. Remove Duplicates from Sorted List Easy
82. Remove Duplicates from Sorted List II Medium
2487. Remove Nodes From Linked List Medium (1454)

Insert

Problem Difficulty

Reverse

Problem Difficulty Notes
206. Reverse Linked List Easy Preserve next before reversing.
92. Reverse Linked List II Medium Locate beforeLeft and afterRight, then reverse.
24. Swap Nodes in Pairs Medium
25. Reverse Nodes in k-Group Hard Count k nodes, reverse, relink.

Two Pointers

Problem Difficulty Notes
19. Remove Nth Node From End of List Medium fast goes n steps, then move together.
61. Rotate List Medium fast goes k steps, then move together.
143. Reorder List Medium Find middle, reverse second half, merge two halves.
141. Linked List Cycle Easy fast and slow move together, if they meet, there is a cycle.
142. Linked List Cycle II Medium fast and slow move together, if they meet, there is a cycle.
328. Odd Even Linked List Medium
86. Partition List Medium
160. Intersection of Two Linked Lists Easy Walk A→B, B→A; meet at intersection.

Middle

Problem Difficulty Notes
876. Middle of the Linked List Easy Initialize fast and slow at head, fast goes 2 steps, slow goes 1 step.
2095. Delete the Middle Node of a Linked List Medium
234. Palindrome Linked List Easy Find middle, reverse second half, compare two halves.

Merge

Problem Difficulty
21. Merge Two Sorted Lists Easy
2. Add Two Numbers Medium
23. Merge k Sorted Lists Hard
1669. Merge In Between Linked Lists Medium
2181. Merge Nodes in Between Zeros Medium (1333)

Other

Problem Difficulty Notes
1472. Design Browser History Medium
138. Copy List with Random Pointer Medium
146. LRU Cache Medium
382. Linked List Random Node Medium
1171. Remove Zero Sum Consecutive Nodes from Linked List Medium (1782) Detect repeated prefix sum, cut nodes in between.

Explanation