Pseudocode wanted
|
|||
|
Rank: ? (3)
Member #: 29400 |
I just started programming and i have to solve this problem....Algorithm in pseudocode to multiply two arrays nxn and gives a third array with the result
Lets say i start like this.... A: ARRAY [1...N, 1...N] OF INTEGER B: ARRAY [1...N, 1...N] OF INTEGER C: ARRAY [1...N, 1...N] OF INTEGER I, K, Z, L: INTEGER BEGIN FOR I:=1 UNTILL N REPEAT ?????? » Post edited 2006-12-24, 03:00am by kracivi.
|
||
|
|||
|
|||
|
Rank: ? (119)
Member #: 28292 |
I suppose you want to multiply two matrces
A: ARRAY [1...N, 1...N] OF INTEGER B: ARRAY [1...N, 1...N] OF INTEGER C: ARRAY [1...N, 1...N] OF INTEGER I, K, Z, L: INTEGER BEGIN FOR I:=1, UNTILL N REPEAT BEGIN: FOR L := 1 UNTILL N REPEAT BEGIN: Z:= 0 FOR K:=1 UNTILL N REPEAT BEGIN: Z = Z + A[I][K] * B[K][L] END C[I][L] := Z END END |
||
|
Please login or register to post a reply.