abhi9u@lemmy.world to Programming@programming.devEnglish · 11 months agoA Linear Algebra Trick for Computing Fibonacci Numbers Fastcodeconfessions.substack.comexternal-linkmessage-square6fedilinkarrow-up147arrow-down15
arrow-up142arrow-down1external-linkA Linear Algebra Trick for Computing Fibonacci Numbers Fastcodeconfessions.substack.comabhi9u@lemmy.world to Programming@programming.devEnglish · 11 months agomessage-square6fedilink
minus-squarecbarrick@lemmy.worldlinkfedilinkEnglisharrow-up2·11 months agoThe article is comparing to the dynamic programming algorithm, which requires reading and writing to an array or hash table (the article uses a hash table, which is slower). The naive algorithm is way faster than the DP algorithm.
The article is comparing to the dynamic programming algorithm, which requires reading and writing to an array or hash table (the article uses a hash table, which is slower).
The naive algorithm is way faster than the DP algorithm.