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
What are the chances that we are living in a simulation? (Percentage)
harkovskaia [24]
Round about 95% Chance to living in a Simulation
5 0
3 years ago
Read 2 more answers
Suppose for the worst case, given input size n: Algorithm 1 performs f(n) = n2 + n/2 steps Algorithm 2 performs f(n) = 12n + 500
melomori [17]

Answer:

29

Explanation:

for n=28:

--------------

Algorithm 1 performs f(n) = n2 + n/2 = 28*28 + 28/2 = 798

Algorithm 2 performs f(n) = 12*28 + 500 = 836

for n=29

--------------

Algorithm 1 performs f(n) = n2 + n/2 = 29*29 + 29/2 = 855.5

Algorithm 2 performs f(n) = 12*29 + 500 = 848

so, for n=29, algorithm 2 will be faster than algorithm 1

6 0
2 years ago
File "f2" has a size of 2. Why? A. It contains the string "f1". B. It contains two blank lines.
Aneli [31]

Answer:

A. It contains the string "f1"

7 0
3 years ago
Consider the three major Vs as Volume, Velocity and Variety along with other Big Data contexts. Match the terms with the short s
12345 [234]

Answer:

See explaination

Explanation:

(MapReduce) = Programming Model

(Variability) = Sentiment analysis

(Feedback Loop Processing) = Health Systems transit

(volume, velocity, variety) = Big Data, applied to collect data

(Hadoop) = A Big Data Application that handles very large-sized block of data.

5 0
2 years ago
Analog method is also known us
Andreas93 [3]

Hi there! Thank you for choosing Brainly to ask your question. I would be happy to assist you today by answering. You were a little bit unclear, but I hope this answers your question. - Analogue methods refer to all manual methods where no computers are used, but with the advent of digital computers the term analogue is also used for analogue methods of computing data. An analogue signal varies continuously, according to information, and thereby the data are represented in a continuous form.

8 0
2 years ago
Other questions:
  • Do you think our attitude (whether positive or negative) is something we are born with or that we have power to control within o
    5·2 answers
  • Describe how electrons move between atoms to create electricity.
    7·2 answers
  • Which statement is true of integrating an expert system into the database component of a decision support system (DSS)? a. It re
    14·2 answers
  • Elizabeth works for a local restaurant at the end of her shift she read she’s required to write in the time that she arrived in
    14·1 answer
  • Juan has performed a search on his inbox and would like to ensure the results only include those items with attachments which co
    14·2 answers
  • Select the correct answer. Which input device uses optical technology?
    5·1 answer
  • Jessie will make and sell the trending Baked California Maki. Her Peso mark up is 5.00. Selling price PHP 15.000. How much will
    7·1 answer
  • How to scan a screenshot on Brainly?
    9·2 answers
  • What is the most appropriate data type for each of these items?
    15·1 answer
  • Because his father _____ his ten-speed bike away to punish him for his failing grades, the boy sulked for two days.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!