Hi,
I have a problem on the homework for my algorithms class that involves determining
how many pages are transferred between disk and main memory in an operation on
a two dimensional array.
The LRU method is the replacement strategy in this problem. We are to assume that
each page contains 1024 words. The array is a 2 dimensional 4096 x 4096 array.
Each array element takes up one word.
Here is the algorithm that we are analyzing.
1 2 3 4
|
for I := 1 to 4096 do
for J := 1 to 4096 do
{ A[I, J] := A[I, J] * B[I, J];
B[I,J] := C[N - I + 1, J] *A[I, J]; }
|
My question is this: if I am accessing, for example element A[2, 3] does the
entire row 2 get loaded into memory? ie, do all 4 pages of row 2 get loaded.
Or does just the first page of row 2 get loaded since it is the page that
contains element 3.
Thanks