For problem 1, finding a number that is repeated just once is enough.
Scan the array to see if there are two adjacent numbers that are
equal. If so, that is your repeated number. Otherwise, look for the
repeat in the first 5 numbers. O(n).

Dave

On Jul 1, 11:43 am, sharad <[email protected]> wrote:
> 1.an array of 2n+1 elements is given .....one element is repeated n
> times
> and rest all are different.....find the no repeated.
> 2.same question as above but this time other no's are not
> different ..i.e
> they can repeat.

-- 
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