Linked List demands skills of managing pointers very well.
Most problems are not that hard for you to solve. But to get bug-free, you need to think it through.
Key Points:
- Add a dummyNode, if head node might be changed
- How to process current node?
Make sure the pointers are in-order
- How to move to next node?
If you have changed the original node, the next pointer might not be what you want
- Whether we need to maintain the previous node?
The most impressive problems to me:
See all linkedlist problems: #linkedlist
- Review: Linked List Problems
- LintCode: Middle of Linked List
- LintCode: Insert Node in Sorted Linked List
- LintCode: Find Node in Linked List
- LintCode: Count Linked List Nodes
- LintCode: Convert Linked List to Array List
- LintCode: Convert Array List to Linked List
- Leetcode: Swap Nodes in Pairs
- Leetcode: Split Linked List in Parts
- Leetcode: Sort List
- Leetcode: Rotate List
- Leetcode: RLE Iterator
- Leetcode: Reverse Nodes in k-Group
- Leetcode: Reverse Linked List II
- Leetcode: Reverse Linked List
- Leetcode: Reorder List
- Leetcode: Remove Nth Node From End of List
- Leetcode: Remove Linked List Elements
- Leetcode: Remove Duplicates from Sorted List II
- Leetcode: Remove Duplicates from Sorted List
- Leetcode: Plus One Linked List
- Leetcode: Partition List
- Leetcode: Palindrome Linked List
- Leetcode: Online Stock Span
- Leetcode: Odd Even Linked List
- Leetcode: Middle of the Linked List
- Leetcode: Merge Two Sorted Lists
- Leetcode: Merge k Sorted Lists
- Leetcode: Linked List Cycle II
- Leetcode: Linked List Cycle
- Leetcode: Linked List Components
- Leetcode: Knight Dialer
- Leetcode: Intersection of Two Linked Lists
- Leetcode: Insertion Sort List
- Leetcode: Insert into a Cyclic Sorted List
- Leetcode: Flatten Binary Tree to Linked List
- Leetcode: Flatten a Multilevel Doubly Linked List
- Leetcode: Exam Room
- Leetcode: Design Linked List
- Leetcode: Delete Node in a Linked List
- Leetcode: Copy List with Random Pointer
- Leetcode: Convert Binary Search Tree to Sorted Doubly Linked List
- Leetcode: Add Two Numbers II
- Leetcode: Add Two Numbers
See more blog_posts.
Share It, If You Like It.