The only thing I'll add to the "use a hash" advice, is don't read the data into two arrays first. You'll likely to run out of memory because of the duplication.
Far better to build a hash directly from the smaller set as you read it in. And the read the second set one-by-one and test it against the hash. For datasets of this size, that likely to save you a large amount of memory, and quite a bit of time.
In reply to Re: Searching first array in second array.
by BrowserUk
in thread Searching first array in second array.
by paragkalra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |