Translate the matrix multiplication algorithm into a program
which finds the product C of an nxm matrix A and pxn matrix B.
Test the program using
A= 4 -3 5
6 1 -2
23 -7 -3
B= 5 -1 6 2
0 3 -2 1
Algorithm
Let
A be an nxm matrix, and let B be a pxn matrix array. This algorithm stores the
product of A and B in a mxp matrix array C
Repeat
Steps 2 to 4 for I=1to M
Repeat Steps 3 to 4 for J=1to N
Set C[I,J]=0 Initialize
C[I,J]
Repeat for K=1 to P
C[I,J]=C[I,J]+A[I,K]*B[K,J]
[END of inner loop]
[END of Step 2 loop]
[END
of Step 1 loop]
Source
Code:
- Example No:03
the location LOC where ITEM appears in ARRAY or return LOC=0.?
Source Code:
- Example No:04
Translate binary
search and insertion algorithm into a program which finds either the location
LOC where ITEM appears in ARRAY or the location
LOC where ITEM should be inserted
into ARRAY. (For object 3, 4, and 5 take an array of 10 elements given below)?
Source
Code:
0 comments:
Post a Comment