• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE | CSE 2023 | Question 57

Consider the following two-dimensional array D in the C programming language, which is stored in row-major order:

int D[128][128];

Demand paging is used for allocating memory and each physical page frame holds 512 elements of the array D. The Least Recently Used (LRU) page-replacement policy is used by the operating system. A total of 30 physical page frames are allocated to a process that executes the following code snippet:

for (int i = 0;  i <  128;  i++) 
for (int j = 0; j < 128; j++)
D[j][i] *= 10;

The number of page faults generated during the execution of this code snippet is

(A)

2048

(B)

512

(C)

4096

(D)

1032

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments