Bash Script - Fibonacci

后端 未结 6 1585
日久生厌
日久生厌 2021-01-24 11:05

I was trying to make a recursive function that can calculate the Fibonacci of the enter number, by the way I got stuck on how to get the values obtained by the recursion.

<
6条回答
  •  说谎
    说谎 (楼主)
    2021-01-24 11:31

    I do believe that you know "coding FIBONACCI with recursion is NOT a good idea".

    recursive Fib() -> O(2^n)
    iterative Fib() -> O(n)

    Please reference to this youtube video.

提交回复
热议问题