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: Validate Stack Sequences
- Leetcode: Valid Boomerang
- Leetcode: Two City Scheduling
- Leetcode: Swap Nodes in Pairs
- Leetcode: Stream of Characters
- Leetcode: Split Linked List in Parts
- Leetcode: Split Array Largest Sum
- Leetcode: Sort List
- Leetcode: Smallest String Starting From Leaf
- Leetcode: Satisfiability of Equality Equations
- Leetcode: Rotate List
- Leetcode: Robot Bounded In Circle
- Leetcode: RLE Iterator
- Leetcode: Reverse Nodes in k-Group
- Leetcode: Reverse Linked List II
- Leetcode: Reverse Linked List
- Leetcode: Reveal Cards In Increasing Order
- 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: Previous Permutation With One Swap
- Leetcode: Plus One Linked List
- Leetcode: Partition List
- Leetcode: Palindrome Linked List
- Leetcode: Out of Boundary Paths
- Leetcode: Online Stock Span
- Leetcode: Online Election
- Leetcode: Odd Even Linked List
- Leetcode: Occurrences After Bigram
- Leetcode: Numbers At Most N Given Digit Set
- Leetcode: Number of Longest Increasing Subsequence
- Leetcode: Nth Magical Number
- Leetcode: Moving Stones Until Consecutive
- Leetcode: Most Stones Removed with Same Row or Column
- Leetcode: Middle of the Linked List
- Leetcode: Merge Two Sorted Lists
- Leetcode: Merge k Sorted Lists
- Leetcode: Maximum Width Ramp
- Leetcode: Linked List Cycle II
- Leetcode: Linked List Cycle
- Leetcode: Linked List Components
- Leetcode: Last Stone Weight
- Leetcode: Kth Smallest Number in Multiplication Table
- Leetcode: Knight Dialer
- Leetcode: Intersection of Two Linked Lists
- Leetcode: Insufficient Nodes in Root to Leaf Paths
- Leetcode: Insertion Sort List
- Leetcode: Insert into a Cyclic Sorted List
- Leetcode: Height Checker
- Leetcode: Flower Planting With No Adjacent
- Leetcode: Flatten Binary Tree to Linked List
- Leetcode: Flatten a Multilevel Doubly Linked List
- Leetcode: Find K-th Smallest Pair Distance
- Leetcode: Exam Room
- Leetcode: Duplicate Zeros
- Leetcode: Distant Barcodes
- Leetcode: Design Linked List
- Leetcode: Delete Node in a Linked List
- Leetcode: Delete Columns to Make Sorted II
- Leetcode: Copy List with Random Pointer
- Leetcode: Convert Binary Search Tree to Sorted Doubly Linked List
- Leetcode: Broken Calculator
- Leetcode: Binary String With Substrings Representing 1 To N
- Leetcode: Binary Search Tree to Greater Sum Tree
- Leetcode: Best Sightseeing Pair
- Leetcode: Bag of Tokens
- Leetcode: Available Captures for Rook
- Leetcode: Array of Doubled Pairs
- Leetcode: Add Two Numbers II
- Leetcode: Add Two Numbers
- Leetcode: Accounts Merge

See more blog_posts.

Share It, If You Like It.