Free2Code
 
Time: 2008-11-21, 10:21pm
Pseudocode wanted
Subject: Pseudocode wanted  ·  Posted: 2006-12-24, 02:59am
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.

 
  Reply to this ·  Post link ·  Top
Subject: Re: Pseudocode wanted  ·  Posted: 2006-12-26, 04:37am
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


 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

icons