For last couple of weeks i have been coding various programs in which i have to use the nested for loops. This raises the complexity of my code to O(n^2). Is there a way i can use the parallel algorithms to reduce this complexity. I read something about the prefix sum algorithms, but there is no sufficient explanation available on that. For example a code is given below. Any help please ??
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
if(array1[i]==array2[j];
System.out.println(array1[i]);
}
}