@Siddharth

If the range is 0 to 9 as specified in the first problem statement, it will
be just finding the two minimum elements.

However if the input range is unknown, it can be solved through an entirely
different approach after sorting and then using two pointers moving either
side from the positive-negative boundary. O(nlogn) + O(n)  = O(nlogn)

Thanks,
Balaji.

On Mon, Jan 24, 2011 at 11:03 PM, siddharth srivastava
<[email protected]>wrote:

> If the same question is modified as:
> Find two numbers whose sum is closest to zero in the given array.
>
>
> On 24 January 2011 16:08, juver++ <[email protected]> wrote:
>
>> Its name is meet-in-the-middle technique.
>>
>> --
>> 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]<algogeeks%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
> Siddharth Srivastava
>
> When you have learned to snatch the error code from the trap frame, it will
> be time for you to leave.
>
> --
> 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]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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