You could use a boolean array to mark which numbers you have on the list.

2010/1/31 Banoo <banoo.rekh...@gmail.com>

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


-- 
Mario Ynocente Castro
20074016B
FIIS - UNI

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

Reply via email to