Suppose we have an 8way set with resident blocks denoted by

Suppose we have an 8-way set with resident blocks denoted by letters as shown in the picture below. Show the content of the set after each of the following access pattern: A rightarrow B rightarrow K rightarrow M rightarrow D. Assume LRU replacement mechanism. Show the LRU count of all ways after each access.

Solution

public class main { private int length; private String word; private String result; private String buffer; public main(String aword) { result = \"\"; word = aword; length = word.length(); buffer = \"\"; } public String guess(String aguess) { for(int i = 0; i < length; i++) { buffer = aguess.substring(i, i+1); if(word.indexOf(buffer) == i) result = result + buffer; else if ((word.indexOf(buffer) != -1)) result = result + \"+\"; if ((word.indexOf(buffer) == -1)) result = result + \"*\"; } return result; } }
 Suppose we have an 8-way set with resident blocks denoted by letters as shown in the picture below. Show the content of the set after each of the following acc

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site