Search common elements of two sets with O(n) comparisons.