Finding the closest fibonacci numbers

前端 未结 11 2156

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, th

11条回答
  •  温柔的废话
    2021-02-02 14:25

    Use the closed form formula: http://en.wikipedia.org/wiki/Fibonacci_number#Closed-form_expression

    Then binary search

提交回复
热议问题