407 views

1 Answer

0 votes
0 votes

"Top-down or bottom-up" view is most obvious if your computation is recursive, but recursion is not necessary for either. In particular: 1) a function can be memoized (cached) even though it is part of an iterative algorithm, and 2) though DP is very iterative, it can be defined recursively in terms of its history. 

Source: https://www.quora.com/What-is-the-difference-between-bottom-up-and-top-down-dynamic-programming-method

Related questions

0 votes
0 votes
2 answers
1
Debargha Mitra Roy asked Apr 10
121 views
What is the output of the below code?#include <stdio.h void main() { static int var = 5; printf("%d ", var ); if (var) main(); }a. 1 2 3 4 5b. 1c. 5 4 3 2 1d. Error
3 votes
3 votes
3 answers
2
Laxman Ghanchi asked May 19, 2023
1,177 views
#include<stdio.h void print(int n) { printf("Hello "); if(n++ == 0) return ; print(n); n++; } int main() { void print(); print(-4); }How many times printf execute?? And H...
0 votes
0 votes
1 answer
3
Laxman Ghanchi asked May 19, 2023
693 views
#include<stdio.h>void print(int n){ printf("Hello "); if(n++ == 0) return ; print(n); n++;}int main(){ void print(); print(-4);}