Question: step - by - stepGiven two sorted arrays A and B , each consisting of n unique elements, write the most efficient algorithm to find

step-by-stepGiven two sorted arrays A and B, each consisting of n unique elements, write the most efficient algorithm to find the intersection of A and B. Analyze the complexity of your algorithm.
Ex1: Input:
A ={1,3,4,6,7,8,10,12,13,15}
B ={1,2,4,5,8,9,15,16,17,18}
Output : {1,4,8,15}
Ex2: Input:
A ={0,11,45,196,200,466,528,1037,10026}
B ={1,200,311,397,778,801,959,1501,2765}
Output : {200}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!