You have unread notifications. Click here.

Maze Memoization Code

Loading ...
Start Coding
#include <iostream>
using namespace std;
int n=3,m=3;
int x[3][3]={{10,15,1},
---{10,1 ,1},
int vis[3][3];
int solve(int i, int j){
-if(i==n || j==m)
--return 0;
-if( vis[i][j] != 0)
--return vis[i][j];
-int a = solve(i, j+1);
-int b = solve(i+1,j);
-return vis[i][j] = x[i][j] + (a > b ? a : b);
int main() {
-cout<< solve(0,0) <<endl;


English Version


Answer the following questions according to what you learned from the video.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Comments & Feedback

ملحوظة يتم مراجعة التعليقات قبل ظهورها من قبل الإدارة. رجاء عدم كتابة نفس التعليق أكثر من مرة.
Back to Course