In search of the best algorithm

I am in need of best algorithm for a problem.
Problem: There are two arrays array1 and array2 each containing thousand elements. The common elements between both the arrays are to be printed. Please suggest the best algorithm to do this. I would be greatly obliged. Thanks.
I dont know anything about C++..can I please have the algorithm in C??? I just need the algorithm..code is not necessary.. Thanks..
Last edited on
Topic archived. No new replies allowed.