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 is the missing term in the code that handles that error??
kykrilka [37]

Answer:

try typing that into gooy gle im sorry if i didnt help

if tickets >400 What is the missing term in the code that handles that error??wat over400error

Explanation:

3 0
3 years ago
Which of the following is an example of a currency Number format in Excel?
Elena L [17]

$21.08 is an example of a currency Number format in Excel

<u>Explanation:</u>

For items like currency, one can format numbers in cells in Excel.

To view all possible number formats, click the Dialog Box Launcher attached to Number on the Home tab in the Number group.

In the Format Cells dialog box, in the Category list, click Currency or Accounting.

In the Symbol box, tick the currency symbol.

In the Decimal places box, insert the number of decimal places.

Employed for common financial values and presents the default currency figure with quantities.

Ctrl+Shift+$ is a shortcut to represent currency values.

8 0
3 years ago
Write a method that prints on the screen a message stating whether 2 circles touch each other, do not touch each other or inters
beks73 [17]

Answer:

The method is as follows:

public static void checkIntersection(double x1, double y1, double r1, double x2, double y2, double r2){

    double d = Math.sqrt(Math.pow((x1 - x2),2) + Math.pow((y1 - y2),2));

    if(d == r1 + r2){

        System.out.print("The circles touch each other");     }

    else if(d > r1 + r2){

        System.out.print("The circles do not touch each other");     }

    else{

        System.out.print("The circles intersect");     }

}

Explanation:

This defines the method

public static void checkIntersection(double x1, double y1, double r1, double x2, double y2, double r2){

This calculate the distance

    double d = Math.sqrt(Math.pow((x1 - x2),2) + Math.pow((y1 - y2),2));

If the distance equals the sum of both radii, then the circles touch one another

<em>     if(d == r1 + r2){</em>

<em>         System.out.print("The circles touch each other");     }</em>

If the distance is greater than the sum of both radii, then the circles do not touch one another

<em>    else if(d > r1 + r2){</em>

<em>         System.out.print("The circles do not touch each other");     }</em>

If the distance is less than the sum of both radii, then the circles intersect

<em>    else{</em>

<em>         System.out.print("The circles intersect");     }</em>

}

6 0
3 years ago
The advantage of returning a structure type from a function when compared to returning a fundamental type is that a. the functio
inessss [21]

Answer:

The advantage of returning a structure type from a function when compared to returning a fundamental type is that

e. a and b only.

Explanation:

One advantage of returning a structure type from a function vis-a-vis returning a fundamental type is that the function can return multiple values.  The second advantage is that the function can return can an object.  This implies that a function in a structure type can be passed from one function to another.

7 0
2 years ago
Pressing and holding the what key while dragging a corner handle of an image proportionally resizes it
sasho [114]
The left key I believe. I have a Mac so 
8 0
3 years ago
Read 2 more answers
Other questions:
  • Given the following code, what is output by the method call, mystery(6 * 8)? public static void mystery (int x[]) { System.out.p
    10·1 answer
  • What is “centrifugal bumble puppy”? why is it important for games to require a complicated apparatus?
    10·2 answers
  • What must you do to enable the members of the rome backup group to perform backup operations on the local system?
    6·1 answer
  • Internet control message protocol (icmp) is a method of ip address assignment that uses an alternate, public ip address to hide
    7·1 answer
  • On a hard disk each track is divided into invisible wedge-shaped sections called _______
    15·1 answer
  • A network administrator identifies sensitive files being transferred from a workstation in the LAN to an unauthorized outside IP
    12·1 answer
  • 50 points for each person brainless goes to the best answer
    14·2 answers
  • Your employer's right to electronically monitor you is an issue of ____.
    13·1 answer
  • Systems Software, Inc., is introducing a new piece of sophisticated graphics software. A recently hired writer has been assigned
    8·1 answer
  • Which engineer may design a GPS for a vehicle?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!