Already posted

compare pair wise i.e a[0] and a[1]....a[2] and a[3]..
leave out last 4 elements...
repeated element can be found in 3 comparison for these 3 elements...

total no of comparison in worst case
(n/2+1)


Thanks
Pramod Negi

On Sat, Aug 7, 2010 at 7:14 PM, ankur bhardwaj <[email protected]> wrote:

> we can do one thing. compare first element with all others. if it matches
> with any of them, we have found our number, else leave the first number and
> now the required number is available (n/2)+1 times in the rest of the array,
> which can be found in O(n)
>
> --
> 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