Bloomberg L.P. Interview Question: what is the best way to find ... | Glassdoor

Interview Question

Financial Software Developer Intern Interview

what is the best way to find the duplicates within two

  intersecting linked list?

Interview Answer

3 Answers


Use a hashtable?

Sissi on Feb 1, 2013

Hashtable is unnecessary if the linked list is sorted. Use a modified version of the merge algorithm for merge sort. You can get it in O(n) time without extra work.

Daniel on Feb 7, 2013

Well, they didn't want me to use hashtable when I mentioned hashtable. . What they wanted to hear was the Method 2, where you mark visited nodes.

Mani on Jul 28, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.