Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
问题是:给定两个链表。找出它们是否相交。
这个问题有很多复杂的解决方案。找到最后一个节点并检查两个列表是否相同有什么问题?
我看到的围绕这个问题的大多数讨论都对找出两个列表相交的确切节点更感兴趣。如果您只想知道它们是否相交,比较最后一个节点就足够了。