Sail E0 Webinar
Question
Consider the following dynamic programming implementation of the matrix chain problem:#include#includeint mat_chain_multiplication(int *mat, int n){      int arr[n][n];      int i,k,row,col,len;      for(i=1;i
Options:
A .  arr[row][k] "“ arr[k + 1][col] + mat[row "“ 1] * mat[k] * mat[col];
B .  arr[row][k] + arr[k + 1][col] "“ mat[row "“ 1] * mat[k] * mat[col];
C .  arr[row][k] + arr[k + 1][col] + mat[row "“ 1] * mat[k] * mat[col];
D .  arr[row][k] "“ arr[k + 1][col] "“ mat[row "“ 1] * mat[k] * mat[col];
Answer: Option B


The line arr[row][k] + arr[k + 1][col] + mat[row “ 1] * mat[k] * mat[col] should be inserted to complete the above code.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :


Latest Videos

Latest Test Papers