@Chonku, Make that: Your algorithm seems to fail on A = {0,1,-2), B =
(0,2,-3). I was thinking onwa-complement arithmetic instead of twos-
complement.Dave On Aug 18, 11:57 pm, Dave <[email protected]> wrote: > @Chonku, Your algorithm seems to fail on A = {0,1,-1), B = (0,2,-2). > > Dave > > On Aug 18, 7:52 am, Chonku <[email protected]> wrote: > > > > > 1. Sum all the elements of both arrays. If the sum are same then perform > > step 2. If the sum is not different, then arrays are different. > > 2. Xor elements of first array and then xor the result with elements of > > second array. If result is zero, then the arrays are same. > > > On Tue, Aug 17, 2010 at 11:33 PM, amit <[email protected]> wrote: > > > Given two arrays of numbers, find if each of the two arrays have the > > > same set of integers ? 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 [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<algogeeks%2bunsubscr...@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/algogeeks?hl=en.-Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- 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.
