edited by
546 views

1 Answer

0 votes
0 votes
-5 line l=2 to n.  / /chain length

So,for l=2 the 6th line for loop will run from i=1 to n-l+1 and for each i and j value of this for loop the 9th line  for loop will run from

K=i to j-1

9th line for loop is nested under 6th line for loop and 6th line for loop is nested under 5th line for loop

5--for(l=2 to n)

6--{for(I=1 to n-l+1)

     //

9{for(k=i to j-1)

     //

}

}

Related questions

1.6k
views
2 answers
1 votes
firki lama asked Dec 29, 2016
1,565 views
Consider the following chain of matrices $A_{1}$ to $A_{4}$ having dimensions given below$A_{1}\rightarrow 2\times 3$A_{2}\rightarrow 3\times 5$A_{3}\rightarrow 5\times 4$A_ ... $P$ and $Q?$60,140$60,82$60,40$60,92$
4.4k
views
3 answers
1 votes
Parshu gate asked Nov 27, 2017
4,436 views
Which of the following is the recurrence relation for the matrix chain multiplication problem where p[i-1]*p[i] gives the dimension of the i^th matrix? dp[i,j]=1 if i=jdp[i,j]=min{dp[i, ... =jdp[i,j]=min{dp[i,k]+dp[k+1,j]}+p[i-1]*p[k]*p[j]
3.4k
views
2 answers
2 votes
Parshu gate asked Dec 10, 2017
3,370 views
Let $A1, A2, A3, A4, A5$ be five matrices of dimensions $2\times3, 3\times5, 5\times2, 2\times4, 4\times3$ respectively. The minimum number of ... the product $A1, A2 ,A3, A4, A5$ using the basic matrix multiplication method is_______
1.8k
views
1 answers
0 votes
Rohan Mundhey asked Nov 11, 2016
1,752 views
Matrix multiplication is associative and matrix chain multiplication uses following matricesA1 is 30×35A2 is 35×15A3 is 15×5A4 is 5×10A5 is 10×20A6 is 20×25Find the minimum number of multiplications required to compute A1 A2 A3 A4A5A6