CSE 661 QUESTION 8
For the given two pseudo codes, I have written C codes which are as follows:
LOOP A:
For I = 1, 1000
For J = 1, 1000
c(J) = c(J) + a(I, J)*b(J)
CODEA:
LOOP B:
For J = 1, 1000
For I = 1, 1000
c(J) = c(J) + a(I, J)*b(J)
SANGRAM NAVALE SUID: 549902283
CSE 661 QUESTION 8
CODE B:
Also, I have used a memory profiler for the memory analysis of these codes:
SANGRAM NAVALE SUID: 549902283
CSE 661 QUESTION 8
And the corresponding outputs are:
Conclusion:
We can conclude that Code A is faster than Code B. The execution time of Code A is almost half of
what Code B takes to execute.
SANGRAM NAVALE SUID: 549902283

Report Qsn 8 CA asn 3

  • 1.
    CSE 661 QUESTION8 For the given two pseudo codes, I have written C codes which are as follows: LOOP A: For I = 1, 1000 For J = 1, 1000 c(J) = c(J) + a(I, J)*b(J) CODEA: LOOP B: For J = 1, 1000 For I = 1, 1000 c(J) = c(J) + a(I, J)*b(J) SANGRAM NAVALE SUID: 549902283
  • 2.
    CSE 661 QUESTION8 CODE B: Also, I have used a memory profiler for the memory analysis of these codes: SANGRAM NAVALE SUID: 549902283
  • 3.
    CSE 661 QUESTION8 And the corresponding outputs are: Conclusion: We can conclude that Code A is faster than Code B. The execution time of Code A is almost half of what Code B takes to execute. SANGRAM NAVALE SUID: 549902283