recategorized by
2,738 views
3 votes
3 votes

Determine the number of page faults when references to pages occur in the order $1,2,4,5,2,1,2,4.$ Assume that the main memory can accommodate $3$ pages and the main memory already has the pages $1$ and $2,$ with page $1$ brought earlier than page $2.$ (assume LRU i.e., Least-Recently-Used algorithm is applied)

  1. $3$
  2. $4$
  3. $5$
  4. None of the above
recategorized by

3 Answers

2 votes
2 votes

The main memory already has the pages $1$ and $2$, with page $1$ brought earlier than page $2.$ It means $1,2$  is ${\color{Magenta}{\textbf{not}}}$ a page fault.

$1,2,4,5,2,1,2,4.$

Using LRU(Least -  Recently -  Used) algorithm we got $4$ page faults.

So, the correct answer is $(B).$

Answer:

Related questions

3 votes
3 votes
3 answers
2
Arjun asked Apr 22, 2018
10,805 views
The following $C$ program:{ fork(); fork(); printf("yes"); }If we execute this core segment, how many times the string yes will be printed?Only once2 times4 times8 times
3 votes
3 votes
2 answers
3
Arjun asked Apr 22, 2018
3,730 views
The difference between a named pipe and a regular file in Unix is thatUnlike a regular file, named pipe is a special fileThe data in a pipe is transient, unlike the conte...
4 votes
4 votes
5 answers
4
Arjun asked Apr 22, 2018
4,875 views
Consider a system having $m$ resources of the same type. These resources are shared by $3$ processes $A, B, C,$ which have peak time demands of $3, 4, 6$ respectively. Th...