Ya as Ashish said hashing is the best solution :)

On Fri, Jan 14, 2011 at 6:00 PM, Ashish Goel <ashg...@gmail.com> wrote:

> ideally, a hashMap would be preferred
>
> walk through one array and set the corresponding entry, and then through
> another array, if any entry found, then they are not disjoint.
>
> Best Regards
> Ashish Goel
> "Think positive and find fuel in failure"
> +919985813081
> +919966006652
>
>
> On Fri, Jan 14, 2011 at 3:35 PM, bittu <shashank7andr...@gmail.com> wrote:
>
>> how to find if two arrays of size n are disjoint or not in O(n)
>> time ?? You can use only O(n) space............
>> The elements are +ve in the range 0 to n power 100..........
>>
>>
>>
>> Regards
>> Shashank Mani
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
>> .
>> 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 algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
S.Nishaanth,
Computer Science and engineering,
IIT Madras.

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

Reply via email to