Question: Write a program, using your favorite computer ( under some operating system that must support VMM ) and your favorite programming language, which demonstrates that

Write a program, using your favorite computer (under some operating system that
must support VMM) and your favorite programming language, which demonstrates that
the timings of matrix addition differ substantially for large enough matrices, depending
whether you use Version 1 or Version 2:
for i:=1 to n do
for j:=1 to n do
C [ i , j ] : = A [ i , j ]+ B [ i , j ]
Version 1
for j:=1 to n do
for i:=1 to n do
C[i,j]:=A[i,j]+B[i,j]
Version 2
Specifically, use this sequence of values for n,128,256,512,1024,2048,4096,8192,
16384,32768, and 65536, and study the timings of both versions. (Be aware that some
Write a program, using your favorite computer (

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!