33,006
社区成员
发帖
与我相关
我的任务
分享
Assume you have two singly linked lists, denoted as L1 and L2. It is possible that L1 and L2
meet on some node and have a common tail. If L1 has m nodes and L2 has n nodes, then what is
the best time complexity to check if the two linked lists meet and to find out the meeting point?
(Only O(1) constant amont of extra storage space is allowed.)
A. O((m+n)*log(m+n))
B. O(m*n)
C. O(m+n)
D. O((m+n)*log(m*n))
E. O(log(m*n))