Finding the closest fibonacci numbers
问题 I am trying to solve a bigger problem, and I think that an important part of the program is spent on inefficient computations. I need to compute for a given number N, the interval [P, Q], where P is the biggest fibonacci number that is <= to N, and Q is the smallest fibonacci number that is >= to N. Currently, I am using a map to record the value of the fibonacci numbers. A query normally involves searching all the fibonacci numbers up to N, and it is not very time efficient, as it involves a