travse array and check that if(a[i]==a[i+1]||a[i]==a[i+2]); if more then n/2 no are there then that condition will satisfy ...adjust with boundary condition
On Thu, Aug 5, 2010 at 6:36 AM, AlgoBoy <manjunath.n...@gmail.com> wrote: > an array in which n/2 elements are unique...and the remaning n/2 have > the same elements but reapeated n/2 times. can anyone suggest a linear > solution with constant space/... > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@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 algoge...@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.