1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Bogdan [553]
4 years ago
11

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

m with pages of size 200. Asmall 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 the following array-initialization loops? Use LRU replacement, and assume that page frame 1 contains the process and the other two are initially empty. a. for (int j = 0; j < 100; j++) for (int i = 0; i < 100; i++) A[i][j] = 0; b. for (int i = 0; i < 100; i++) for (int j = 0; j < 100; j++) A[i][j] = 0;
Computers and Technology
1 answer:
bogdanovich [222]4 years ago
6 0

Answer:

Check the explanation

Explanation:

An integer (int) is of two different bytes and each page has 200 bytes in length. What this means is that each row of array A (100 int) will fits perfectly in a page.

(a) For the initial or first array-initialization loop, one column is processed at a time, so a page fault will be generated at every inner loop iteration, with a total of 100*100=10,000 page faults.

(b)  And when it comes to the second array-initialization loop, one row is processed at a time, and a page fault is generated at every outer loop iteration, with a total of 100 page faults.

Hence second array-initialization loop, has better spatial locality.

You might be interested in
What is the check digit for the following original product number: 140501941 ? *
Natasha_Volkova [10]

Explanation:

I think it is 7, but I could be wrong..... sorry

8 0
3 years ago
Read 2 more answers
What is Recursion in Java?
wel

Answer:

Recursion is a process of defining a method that calls itself repeatedly

Explanation:

Recursion is a basic programming technique of defining a method that calls itself repeatedly.

One practical example is using recursion to find the factorial of a number.

Consider the following java code below, it uses recursion to solve for the factorial of a number.

class Main {

   public static void main (String[] args) {

       System.out.println("Factorial of 3 is " + factorial(3));

       System.out.println("Factorial of 5 is " + factorial(5));

       System.out.println("Factorial of 7 is " + factorial(7));

   }

   //the factorial method uses recursion to find the factorial of the

   // parameter of the integer pass into it

   

   private static int factorial(int n) {

       int result;

       if ( n ==1) return 1;

       result = factorial(n-1) * n;

       return result;

   }

}

6 0
3 years ago
A student wants to count the number of shows that meet both of the following criteria.
o-na [289]

Answer:

ii. (genre = "talk") AND ((day = "Saturday") OR (day = "Sunday"))

Explanation:

it feels like the right answer to choose, i may not be an expert but this is what i feel like the answer is.

5 0
3 years ago
Please help me, please help me,
Goryan [66]

Answer:

In what do you need help?

7 0
3 years ago
Read 2 more answers
A GPS _____. creates a technical drawing gives directions to a new location calculates the interest rate of a new car loan organ
aev [14]

gives directions to a new location

obviously

3 0
3 years ago
Other questions:
  • Describe the Say It, Cover It, Resay It method.
    14·2 answers
  • after installing a secondary hard drive what needs to be done to the hard drive and what do these two task do?
    9·1 answer
  • In word, the ____ presents the most accurate view of how your document will look when printed, displaying the entire page on scr
    15·1 answer
  • What are the features of the Outline view in Word? Select three options.
    12·2 answers
  • After spending a year in India, Giovanna returns home to the United States and is inspired to raise money to help her new friend
    14·1 answer
  • Two different applications that make use of the barcode
    5·1 answer
  • What is the job of a bootloader?
    10·2 answers
  • JOIN GO.OGLE CLASSROOM IF YOUR A FAN OF FRANK OCEAN
    15·2 answers
  • What are the types of technology that is use in education and what are their usages​
    8·1 answer
  • . Imagine that you were programming without an IDE. What problems might you encounter?​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!