Nice Confusion... :)

Consider the following case
A[M] = {1,1,3,12};
B[N] = {1,2,12}

here again i think answer should be {1,1,12} , why are u binding one
occurrence of 1 in array A with one in B.  Question is which elements of
first array is present in second array. so for this case A[0], A[1], A[3]
are present so answer should be still {1,1,12} whether or not it occurs
multiple times in B.

now the question remains is whether to report duplicate entries or not. both
have been handled above with same time and space complexity.

Any Questions are Welcome :)

On Wed, Jun 15, 2011 at 1:08 AM, Arpit Sood <soodfi...@gmail.com> wrote:

> i meant if N = { 1, 1, 1, 2, 12}
> and M = { 1, 1, 3, 12}
> then answer should be = {1, 1, 12}
>
>
> On Mon, Jun 13, 2011 at 8:06 PM, sunny agrawal <sunny816.i...@gmail.com>wrote:
>
>> no we can take care of duplicates without any extra memory
>> modify 2nd step of my previous solution as follows
>>
>> if T[a[i]] is set then this element is there in second array so report
>> this element and Reset T[a[i]].
>>
>> now no duplicates will be reported. and only 1025 bits will be required.
>> any failures ??
>>
>>
>> --
>> Sunny Aggrawal
>> B-Tech IV year,CSI
>> Indian Institute Of Technology,Roorkee
>>
>>  --
>> 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.
>>
>
>
>
> --
> Regards,
> Arpit Sood
>
> --
> 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.
>



-- 
Sunny Aggrawal
B-Tech IV year,CSI
Indian Institute Of Technology,Roorkee

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