Thomson Reuters

  www.thomsonreuters.com
  www.thomsonreuters.com

Interview Question

Senior Software Engineer Interview New York, NY

find common numbers in 2 arrays of integer, try to use O(N).

 
Tags:
o(n)
Answer

Interview Answer

2 Answers

0

Use HashMap

Anonymous on Mar 13, 2013
0

you could use set_intersection in STL to find the common numbers, but the arrays should be sorted, this would give O(m+n).

Shebu Appukuttan on Apr 1, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.