Dynamic Programming - Fibonacci
问题 So basically, I am a learning programmer and this week I was introduced to dynamic programming. Our task was to find the Fibonacci sequence using dynamic programming. This pseudo code was supplied which would obviously be in a function: init table to 0s if n ≤ 1 return n else if table[n-1] = 0 table[n-1] = dpFib(n-1) if table[n-2] = 0 table[n-2] = dpFib(n-2) table[n] = table[n-1] + table[n-2] return table[n] The majority of this was simple to change to code but I'm not sure how to initialise