linear time will be possible if we use some linear time algorithm to sort -- say counting sort , but tht requires linear memory too...

On 9/12/06, Flávio Barata <[EMAIL PROTECTED]> wrote:

Linear time??
How?? :-)
Can you figure this out?

-- flavio

Arun wrote:
> sort A and B seperately -> O(nlgn)..
> add A[i]and B[i]  - O(n)
> so, O(nlgn) .
> linear time maybe possible.
>
>
> On 8/25/06, Amal <[EMAIL PROTECTED]> wrote:
> >
> >
> > There are 2 arrays say array A and array B given whose size is 'n'. Now i
> > have to find the first n maximum values of a[i]+b[j] .  I would like to know
> > O(n) or O(n logn ) solutions if some exist.
> >
> > Amal.
> >



+919873428796
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to