Required algorithm performance:
T(n) = O(n), S(n) = O(1).
Algorithm details:
- Find the sizes of two linked lists. If their tails are different, return null.
- Calculate the deviation(D) of two linked lists and let the longer linked list's pointer point to the next Dth node.
- Iterate two linked lists simultaneously until find the common node.