Question: How to use binary search to go through 2 arrays(1 is sorted the other is UNSORTED) and find the similar elements they have? You cannot

How to use binary search to go through 2 arrays(1 is sorted the other is UNSORTED) and find the similar elements they have? 

  • You cannot sort the unsorted array.
  • You will return how many values they share in common in or under n log n time

Please keep this code simplistic, don't use any hashes(etc), just keep it as simple as possible!!!!!

 

Any help is greatly appreciated :)

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!