1,6,3,4,6,5,6,2,6,6
or
1,2,3,6,4,6,5,6,6,6

lovely...


Use a two-step process. First, check for a repeated number in the
> first 4 elements. If none is found, then there are at least n/2-1
> occurrences of the repeated elements in the last n-3 elements, meaning
> that there must be at least two repeated elements in adjacent
> positions. So second, check for equal adjacent numbers in the last n-3
> elements.
>
> Dave
>
> On Aug 5, 8:36 am, AlgoBoy <[email protected]> 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 [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