Question: Implement Matrix-Chain-Order in Java using two files, one tester and one class, by using the algorithm in the photo provided. There should be two types

Implement Matrix-Chain-Order in Java using two files, one tester and one class, by using the algorithm in the photo provided. There should be two types of data outputted:
1. The minimum number of scalar multiplications done.
2. The parenthesization of matrices. Example output of four matrices: A1(A2(A3A4)). Having parenthesis encasing the entire list of matrices is fine too, e.g.: (A1(A2(A3A4))) instead of A1(A2(A3A4)).
The list of matrices should be passed in through your tester. The matrices should each be 2-D. Also have a check to ensure that only valid matrix dimensions will be accepted. E.g. the following list of matrices are incompatible because the number of columns in A1 doesnt match the number of rows in A2:
A1 =5x20
A2 =30x40
A3 =40x50
The tester file should be used to test and demonstrate the capabilities of the class file. The tester would be used to pass in the list of matrices. Output should be the two items mentioned above. Your tester should not be reading from any external file and it shouldnt use command line as inputs.
 Implement Matrix-Chain-Order in Java using two files, one tester and one

MATRIX-CHAIN-ORDER (p) 1 -p.length -1 2 let m[1..n,1..n] and s[1..n -1,2..n] be new tables 3 for i - 1 to n 4 5 forl2 to n 6 // l is the chain length for i = l to n-1 -1 j-i1-1 mll, fork-i to j - 1 10 if q

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!