You may want to specify the two sets consist of what, literal strings, integers, or floating point numbers?
What do the input files look like. Could you cut and paste a small piece from each and share them with us?
How big are the sets? Do they overflow the memory you have, or they can be adequately stored in memory?
Hope to hear from you soon.