Intersection of 2 number arrays Make sure that both the arrays are sorted i= , j=0 while(i<array1.size && j<array2.size) compare each element in the array i.e if (array1[i] == array2[j]) display data else i++ ,j ++