here is the question I need to answer correctly. here below I am also attaching
ID: 3604289 • Letter: H
Question
here is the question I need to answer correctly. here below I am also attaching the pictures of slides so that it could be helpful for u to answer. please also attach the picture of output. as I need to answer this correctly asap
Explanation / Answer
int MatrixChainOrder(int p[], int i, int j)
{
if(i == j)
return 0;
int k;
int min = INT_MAX;
int count;
// place parenthesis at different places between first
// and last matrix, recursively calculate count of
// multiplications for each parenthesis placement and
// return the minimum count
for (k = i; k <j; k++)
{
count = MatrixChainOrder(p, i, k) +
MatrixChainOrder(p, k+1, j) +
p[i-1]*p[k]*p[j];
if (count < min)
min = count;
}
// Return minimum count
return min;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.