From: Joel VanderWerf Date: 2005-08-02T14:12:05+09:00 Subject: Re: algorithm help Ara.T.Howard wrote: > On Tue, 2 Aug 2005, Luiz Esmiralha wrote: > >> He�s trying to identify all the sequences inside the original array. > > > based on the assumptions that > > * array is sorted > * array is huge > * array probably contains zero or one range > * real upper limit of ranges is 2 but, in theory, could be n > > which makes it a bit easier... > > cheers. > > -a How could the array contain zero ranges? Empty array? If I understand the practical assumptions we can make, then there are a bounded number (1,2) of "gaps" between ranges. Why not just binary search for them? -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407