I am looking for the product of matrix A*B and B*A
Enter: Matrices to multiply (A,B)
Size of each matrix(mxn,nxm)
Exit: Products (C,D)
read data
read m
read n
read A
read B
for (i=1 to m and j=1 to n)
read Aij
for (i=1 to n and j= 1 to m)
read Bij
for (i=1 to m and j=1 to m)
Cij=(Aij+Bij)
for (i=1 to n and j=1 to n)
Dij =(Bij x Aij)
Show (Dij, Cij)
to determine the order I need to use n-1 and since the cycle repeats it self n-1 times, however I have two variables here n and m, also how do I determine the worst case scenario and best case scenario? Any help will be apreciated.
2006-11-01
17:28:53
·
1 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design
yahoo messed my indentation...
2006-11-01
17:29:23 ·
update #1