@Dave - There could be another good solution instead of XOR.

If below interpretation of the problem is correct,

Array1 -> contains n elements ( order is irrelevent)
Array2 -> contains all n elements of Array1 ( order is irrelevent) + 1 extra
element which is unique from all n elements of Array1.

==> Then unique element from second array = (Addition of all elements of
Array2) - (Addition of all elements of Array1).

Rajan.

On Thu, Oct 21, 2010 at 8:12 PM, Dave <[email protected]> wrote:

> I think that you are saying that the second array contains all of the
> elements in the first array, plus one additional element. If this is
> the proper interpretation, then just XOR all of the elements of both
> arrays and the result is the additional element.
>
> Dave
>
> On Oct 21, 9:12 am, bittu <[email protected]> wrote:
> > Given 2 array in first array n elements are sorted there in second
> > elements n+1 elements and n elements in 2nd array not ordered and it
> > also contains one extra elements wap to find out extra elements in one
> > pass.
> >
> > Regards
> > Shashank Mani
> > BIT Mesra
>
> --
> 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