Common Routines
Be familiar with the following routines because many linked list questions make use of one or more of these routines in the solution:
- Counting the number of nodes in the linked list
- Reversing a linked list in-place
- Finding the middle node of the linked list using fast/slow pointers
- Merging two lists together
Corner cases
- Single node
- Two nodes
- Linked list has cycle.
<aside>
💡 Tip: Clarify with the interviewer whether there can be a cycle in the list. Usually the answer is no
</aside>
Problems
Recommended LeetCode questions