Answer to Question #160719 in Algorithms for Moriom akter

Question #160719

we know that the tabular computation of a dynamic- programming algorithm helps us to avoid recomputation. prove it using the example of fibonacci numbers.


1
Expert's answer
2021-02-03T05:12:29-0500

The tabular computation of the dynamic programming is a first filling up table. In this we can say that the dynamic programming

var fibBotUp = (n) => {
    var member = [];
    for (var i=0; i <=n; i++) {
        if (i == 0) member[i] = 0;
        else if (i <=2) member[i] = 1;
        else {
            member[i] = member[i-1] + member[i-2];
        }
    }
    return mem[n];
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS