- Actually, most linked list problem can be solved by this algorithm
- Two pointers is one basic algorithm and used widely. One typical origination is quickSort.
A few subtypes
- two pointers move from left to right, slide window
- two pointers move from left, right to middle
- two pointers control two array or list, typically merging
Merge Two Sorted Array
Replicate Duplicates from Single Sorted Array
Reverse Words in a String
Rotate Array
没有评论:
发表评论