Write an algorithm to return the intersect of two arrays.
Sigiloso
Martigan's answer should generally work but it has an O(n^2) running time. There's a better way using hashtables. Create a hashtable with all the elements in the first list. Then go through the second list, hash each entry, and compare to the first table. If there is a collision then the entry exists in both lists and should be added to the intersection list.