can find in O(n) if array is sorted....

On Nov 18, 2007 9:13 AM, dor <[EMAIL PROTECTED]> wrote:
>
> You can do it in O(n log(n)) (without extra space). If you can afford
> O(T) extra space (where T is the largest number in the array, in
> absolute value), you can do it in O(n).
>
>
> On Nov 17, 3:42 pm, geekko <[EMAIL PROTECTED]> wrote:
> > Suppose that you have an array of integers. Given a number X are there
> > any two numbers in the array in which their summation is equal to the
> > X? Can you find a solution in O(n)?
> >
>



-- 
With Best Regards...
-----------
Manish

--~--~---------~--~----~------------~-------~--~----~
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