[algogeeks] Re: fibonacci numbers

2007-01-22 Thread Jair Cazarin
Precalculate them, the apply any search algorithm. On 1/22/07, hijkl [EMAIL PROTECTED] wrote: generate fibonacci numbers untill it exceeds given number x. i.e. n1=1; while(n=x){ prev=n1; n1 = next fibonacci number; } n2= n1+prev; any comments?? -- Jair Cazarin Villanueva

[algogeeks] Re: please help me solve the exercise 14.1-8 of introduction to algorithm

2007-01-22 Thread Sandesh
Hi, suppose the chords are represented as (x1,y1) (x2,y2) and x1 x2 then sort the chords according to x1 - o(nlogn) then for each chords check with how many chords it intersects (consider only x values), logn for each key so another o(nlogn) repeat the procedure with replacing x by y