Given two arrays of numbers, find if each of the two arrays have the same set of integers ? Suggest an algo which can run faster than NlogN without extra space?
use a hash function,
sum up all hash values in first array
sum up all hash values in second array
compare
like checksum problem...
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment