I'm trying to intersect ArrayA and ArrayB values and put them into ArrayC. Is there any faster method than this?
Thanks for your help!Code:
while (i<ArrayA_size && j<ArrayB_size) {
if (ArrayA[i] == ArrayB[j]) {
ArrayC[index++] = ArrayA[i];
i++;
j++;
}
else if (ArrayA[i] < ArrayB[j]) {
i++;
}
else
j++;
}