Suppose we have two Given unsorted arrays A and B ,finding some pair of elements (such that first element belongs to A and the second one belongs to B) whose sum (or difference?) equal to given k - by sorting only one of the arrays .
I wonder if there is an algorithm using good complexity for that. Any way, I habe tried to use that link Given two arrays a and b .Find all pairs of elements (a1,b1) such that a1 belongs to Array A and b1 belongs to Array B whose sum a1+b1 = k , but I found it unhelpful because I dont fond there any reference to a possible solution which uses sorting of only one sort.