Question: ( 1 0 % ) The following procedure is a bottom - up method for matrix chain order. This procedure assumes that matrix A i

(10%) The following procedure is a bottom-up method for matrix chain order. This procedure assumes that
matrix Ai has dimensions pi-1pi for i=1,2,dots,n. Its input is a sequence p=(:p0,p1,dots,pn:), where
p. length =n+1. Let m[i,j] be the minimum number of scalar multiplications needed to compute the
matrix AiAi+1cdotsAj. The procedure uses an auxiliary table m[1..n,1..n] for storing the m[i,j] costs
and another auxiliary table s[1..n-1,2..n] that records which index of k achieved the optimal cost in
computing m[i,j]. Please fill in the empty statements.
n=p. length -1
let m[1..n,1..n] and s[1..n-1,2..n] be new tables
For i=1 to n
m[i,i]=0
For l=2 to n??l is the chain length
For i=1 to n-l+1
j=
(a)(3%)
m[i,j]=
For k=itoj-1
q=
(b)(4%)
Ifq
 (10%) The following procedure is a bottom-up method for matrix chain

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!