On 24 lis, 09:09, kumar raja <rajkumar.cs...@gmail.com> wrote: > @kunzmilan : i did not get u, once explain with example... > > On 23 November 2011 23:47, kunzmilan <kunzmi...@atlas.cz> wrote: Matrix M 0 1 0 0 1 0 1 0 0 multiplied with M(T) 0 0 1 1 1 0 0 0 0 gives 1 0 0 0 2 0 0 0 0. On its diagonal are numbers of repeated elements. kunzmilan
> > > > > > > > > > > > > On 24 lis, 07:02, kumar raja <rajkumar.cs...@gmail.com> wrote: > > > In the given array all the elements occur single time except one element > > > which occurs 2 times find it in O(n) time and O(1) space. > > > > e.g. 2 3 4 9 3 7 > > > > output :3 > > > > If such a solution exist can we extend the logic to find "All the > > repeated > > > elements in an array in O(n) time and O(1) space" > > > > -- > > > Regards > > > Kumar Raja > > > M.Tech(SIT) > > > IIT Kharagpur, > > > 10it60...@iitkgp.ac.in > > > Write the list in the form of a matrix M, e.g. > > > 0 1 0 0... > > > 0 0 1 0... > > > 0 0 0 1... > > > ......etc., > > > and its quadratic form M(T)M shows, how many times each element repeats. > > kunzmilan > > > -- > > 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 > Kumar Raja > M.Tech(SIT) > IIT Kharagpur, > 10it60...@iitkgp.ac.in -- 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.