@Nikhil, Your algorithm seems to fail on A = {0,1,-1), B = (0,2,-2).

Dave

On Aug 17, 8:47 pm, Nikhil Agarwal <[email protected]> wrote:
> Sum all the elements of both the arrays..let it be s1 and s2
> Multiply the elements and call as m1 and m2
> if(s1==s2) &&(m1==m2)
> return 1;else
> return 0;
>
> O(n)
>
>
>
>
>
> 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.
>
> --
> Thanks & Regards
> Nikhil Agarwal
> Senior Undergraduate
> Computer Science & Engineering,
> National Institute Of Technology, 
> Durgapur,Indiahttp://tech-nikk.blogspot.comhttp://beta.freshersworld.com/communities/nitd-
>  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.

Reply via email to