Linked List
Linked List is common data structure:
public class ListNode {
int val;
ListNode next;
ListNode(int x) {
val = x;
next = null;
}
}
But it covers a lot of algorithm strategies with manipulating this kind of data structure.
Routines
- Two Pointers
- Runner Node and Walker Node
- Find a certain point in list
- e.g. Remove Nth Node from End of List
- e.g. Palindrome List
- Find Cycle in Linked List
- Find a certain point in list
- Reverse Node
- Remove Duplicates in List
- Runner Node and Walker Node
- Dummy Node
- e.g. Copy Random Pointer on Linked List
- Sort Algorithms
- e.g. Insertion Sort on Linked List
- e.g. Merge K Sorted Linked List (Assisted with Heap)
- Divide and Conquer
- e.g. Merge Sort Linked List
- e.g. Build a Tree from Linked List