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]
3 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]3 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
Write a program that computes the minimum, maximum, average and standard deviation of the population over time for a borough (en
IrinaK [193]

Answer:

import pandas as pd #importing pandas library as pd

import matplotlib.pyplot as plt #importing matplotlib.pyplot as plt

pop=pd.read_csv('nycHistPop.csv') #reading the csv file

borough=input('Enter borough name:') #asking the user for borough namme

# image=input('Enter image name:')

# pop['Fraction']=pop[borough]/pop['Total']

# pop.plot(x='Year', y='Fraction')

print("Minimum population",pop[borough].min()) #printing the minimum population of borough

print("Maximum population",pop[borough].max()) #printing the maximum population of borough

print("Average population",pop[borough].mean()) #printing the average population of borough

print("Standard deviation",pop[borough].std()) #printing the standard deviation of borough

# fig=plt.gcf()

# fig.savefig(image)

Explanation:

4 0
3 years ago
Blank are what make up the World Wide Web.
andreyandreev [35.5K]
Web pages make this up.
3 0
2 years ago
To view the Picture tools tab, a user must first _____.
Amiraneli [1.4K]
Answer: A select the picture
8 0
2 years ago
Read 2 more answers
Design a TestScores class that has fields to hold three test scores. The class should have a constructor, accessor and mutator m
sweet-ann [11.9K]

Answer:

Answered below

Explanation:

class TestScores {

double test1;

double test2;

double test 3;

public TestScores (double test1, double test2, double teat3){

this.test1= test1;

this.test2 = test2;

this.test3 = teat3;}

//mutator

public setTest1(double test1){

this.test1 = test1;

}

//accessor

public double getTest1(){

return test 1;

}

//Write same accessors and mutators for test2 and test3

public double getTestAverage(){

double sum = test1+test2+test3;

return sum / 3;

}

}

class TestRun{

public static void main (String [] args){

TestScores scores = new TestScores(50.5, 40.0, 80.7)

int average = scores.getTestAverage();

System.out.print(average);

}

6 0
2 years ago
What does a head frame do​
coldgirl [10]

Answer:

The main objects of a head frame, or poppet head, are to support the winding pulley firmly and to guide the cage above the surface to the discharging stage. 

7 0
3 years ago
Other questions:
  • In Outlook 2016, what are the three format options when sending an email message? Check all that apply.
    7·1 answer
  • A group of students are collaborating on an online research project. What is an example of appropriate online behavior?
    10·2 answers
  • During which part of geologic time were dinosaurs most common?
    11·2 answers
  • Anyone wanna play among us UwU code is TAEQPQ
    15·2 answers
  • Idea citizen activation
    9·2 answers
  • A keyboard and touch screen are the most common of ________ devices. select one:
    11·1 answer
  • Sales representatives want to capture custom feedback record details related to each Account. The sales reps want to accomplish
    12·1 answer
  • Whats a hybrid wired network
    9·1 answer
  • You implement basic version control and go through the phase of creating a local repository. Initiate the commands to set up tha
    7·1 answer
  • The 0-1 knapsack problem is the following. A thief robbing a store finds n items. The ith item is worth vi dollars and weighs wi
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!