You are right. This is a much celebrated example implementation in Haskell. The reason I implemented fibonacci the way I did because I wanted to point out how close you can stay to the recursive definition and still implement a fast solution. It also helps to clarify the scaling up to multi dimensional DP. Cheers!
@@crygnusproductions1660 yeah but this solution is O(n) and if I remember correctly (!!) is linear so your solution is quadratic. So dp in haskell stays bad
This video has nothing to do with dynamic programming. The author has no idea what dynamic programming is. The video is nice, but the title does not fit.
fibs = 1 : 2 : zipWith (+) fibs (tail fibs)
You are right. This is a much celebrated example implementation in Haskell. The reason I implemented fibonacci the way I did because I wanted to point out how close you can stay to the recursive definition and still implement a fast solution. It also helps to clarify the scaling up to multi dimensional DP. Cheers!
@@crygnusproductions1660 yeah but this solution is O(n) and if I remember correctly (!!) is linear so your solution is quadratic. So dp in haskell stays bad
This video has nothing to do with dynamic programming. The author has no idea what dynamic programming is. The video is nice, but the title does not fit.