Finding the intersecting node from two intersecting linked lists

前端 未结 6 1515
旧巷少年郎
旧巷少年郎 2020-11-30 22:19

Suppose there are two singly linked lists both of which intersect at some point and become a single linked list.

The head or start pointers of both the lists are kno

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 22:59

    Dump the contents (or address) of both lists into one hash table. first collision is your intersection.

提交回复
热议问题