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