Use the formula for sum of first n natural numbers to get the missing
number.

Thanks & regards,
Sathaiah Dontula

On Mon, Feb 1, 2010 at 4:24 AM, Banoo <[email protected]> wrote:

> hi,
> can you help me solve the following problem?
>
> You are given an unsorted list of n-1 distinct integers from the range
> 1 to n. Write a linear-time algorithm to find the missing integer.
>
>
> Thanks
>
> --
> 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