Fast intersection of two sorted integer arrays

后端 未结 5 597
说谎
说谎 2021-02-04 11:02

I need to find the intersection of two sorted integer arrays and do it very fast.

Right now, I am using the following code:

int i = 0, j = 0;

while (i          


        
5条回答
  •  粉色の甜心
    2021-02-04 12:00

    Are arrCollection1 and arrCollection2 collections of arrays of integers? IN this case you should get some notable improvement by starting second loop from i+1 as opposed to 0

提交回复
热议问题