Re: Algorithm to find break in contiguity
- From: "vinay" <svinay1@xxxxxxxxx>
- Date: 28 Jan 2007 23:20:05 -0800
One way would be
1.) Sum (1 to N )numbers is N(N+1)/2 -->This is sum with the missing
number.
2.)Missing_number= Sum -(Sum of 1 to N-1 numbers)
This can be expanded to find out the missing number from k to N.
-Vinay
.
- Prev by Date: Re: C++ value from union structure using generic class
- Next by Date: Re: Algorithm to find break in contiguity
- Previous by thread: Re: Algorithm to find break in contiguity
- Next by thread: Re: Algorithm to find break in contiguity
- Index(es):