@mohit..:i dint get the logic behind XOR plz explain ..nd ya i dont think
dat you can find second largest in less than O(n).

On Sun, Jul 3, 2011 at 2:43 AM, mohit mittal <mohitm.1...@gmail.com> wrote:

> Dont think that the corresponding elements should be same.
> XOR Should do it anyway.
>
> Btw other question "How would you find the second largest element in an
> array using minimum no of comparisons?Any thing better than O(n)."?
>
>
> On Sun, Jul 3, 2011 at 2:41 AM, aditya kumar <aditya.kumar130...@gmail.com
> > wrote:
>
>> xor will only result if corresponding elements are same . what if in both
>> the array set of integers are same but they arnt corresponding to each other
>> ??
>>
>>
>> On Sun, Jul 3, 2011 at 2:37 AM, Dumanshu <duman...@gmail.com> wrote:
>>
>>> xor all the elements of both arrays ==0
>>> sum of 1st array == sum of 2nd array
>>> no. of elements in 1st == no. of elements in 2nd
>>> if the above conditions are met, they have the same set.
>>> m i missin sth?
>>> On Jul 3, 1:23 am, mittal <mohitm.1...@gmail.com> wrote:
>>> > Given two arrays of numbers, find if each of the two arrays have the
>>> same
>>> > set of ntegers ? Suggest an algo which can run faster than NlogN
>>> without
>>> > extra space?
>>>
>>> --
>>> 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.
>>>
>>>
>>  --
>> 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.
>>
>
>
>
> --
> Mohit Mittal
> 4th year , Computer Engineering
> Student-Coordinator , DTU WebTeam
> Delhi Technological University
>
>  --
> 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.
>

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