Q. Consider the two-dimensional array A: int A[][] = new int[100][100]; where A[0][0] is at location 200 in a paged memo

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Q. Consider the two-dimensional array A: int A[][] = new int[100][100]; where A[0][0] is at location 200 in a paged memo

Post by answerhappygod »

Q. Consider the two-dimensional array A:
int A[][] = new int[100][100];
where A[0][0] is at location 200 in a paged memory system withpages of size 200. A small process that
manipulates the matrix resides in page 0 (locations 0 to 199).Thus, every instruction fetch will be from page 0.
For three-page frames, how many page faults are generated by thefollowing array-initialization loops? Use LRU
replacement and assume that page frame 1 contains the processand the other two are initially empty.
a.
for (int j = 0; j < 100; j++)
for (int i = 0; i < 100; i++)
A[j] = 0;
b.
for (int i = 0; i < 100; i++)
for (int j = 0; j < 100; j++)
A[j] = 0;
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply