Joe wrote:

> Hi,
> In a sequence o,f from 1 to n (1,2,3,...n) numbers, we need to find the
> missing numbers. There will not be duplicates.
> Can you please suggest an algorithm.
> Thanks,
> Joe.

need O(n) time
the array is set[n],
for(i = 1, i <=n ; i++)
      if((set[i] & 1) & (set[i + 1] & 1))
         then miss the number i+1;


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to