let consider the list in two different part one traversing list B with
respect to A and A with B
(a.len,b.len) is always solution
a1=a2=a.len

On Fri, Apr 30, 2010 at 5:35 PM, divya <[email protected]> wrote:
> Given two sorted postive integer arrays A(n) and B(n) (W.L.O.G, let's
> say they are decreasingly sorted), we define a set S = {(a,b) | a \in
> A
> and b \in B}. Obviously there are n^2 elements in S. The value of such
> a pair is defined as Val(a,b) = a + b. Now we want to get the n pairs
> from S with largest values. The tricky part is that we need an O(n)
> algorithm.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/algogeeks?hl=en.
>
>



-- 
~~~~BL/\CK_D!AMOND~~~~~~~~

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to