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
IgorC [24]
2 years ago
13

Consider the following sequence of page references: 1 2 3 3 4 4 1 4 1 3 4. Determine how many page faults will occur with LRU(Le

ast Recently Used) for each of the following algorithms, assuming there are only 2 physical page frames and that both are initially empty.
Computers and Technology
1 answer:
Vsevolod [243]2 years ago
7 0

Answer:

7 page faults

Explanation:

I have created a small Java program that can be seen in the attached picture below. This Java program uses an LRU algorithm in order to find the number of page faults within an array of page references from the references given in the question. Using these references, and the java program we can see that there are a total of 7 page faults. This can be seen in the output highlighted by red in the picture below.

You might be interested in
Write a c++ program that accepts a string from the user and then replaces all occurrences of the letter e with the letter x
mixer [17]

Answer:

#include <iostream>

using namespace std;

int main()

{

   string str;

   cout<<"Enter the string: ";

   cin>>str;

   for(int i=0;str[i]!='\0';i++){

       if(str[i]=='e'){

           str[i]='x';

       }

   }

   cout<<"the string is: "<<str<<endl;

  return 0;

}

Explanation:

First, include the library iostream for using the input/output instructions.

Create the main function and declare the variables.

Then, use the cout instruction and print the message on the screen.

cin store the string enter by the user into a variable.

After that, take a for loop and if-else statement for checking the condition if the string contains the 'e', then change that alphabet to 'x'.

This process continues until the string not empty.

Finally, print the updated string.

6 0
3 years ago
Consider the following method, remDups, which is intended to remove duplicate consecutive elements from nums, an ArrayList of in
MAXImum [283]

Answer:

B. {1, 2, 2, 3, 3, 4, 5}

Explanation:

Given

The above code segment

Required

Determine which list does not work

The list that didn't work is B.\ \{1, 2, 2, 3, 3, 4, 5\}

Considering options (A) to (E), we notice that only list B has consecutive duplicate numbers i.e. 2,2 and 3,3

All other list do not have consecutive duplicate numbers

Option B can be represented as:

nums[0] = 1

nums[1] = 2

nums[2] = 2

nums[3] = 3

nums[4] = 3

nums[5] = 4

nums[6] = 5

if (nums.get(j).equals(nums.get(j + 1)))

The above if condition checks for duplicate numbers.

In (B), when the elements at index 1 and 2 (i.e. 2 and 2) are compared, one of the 2's is removed and the Arraylist becomes:

nums[0] = 1

nums[1] = 2

nums[2] = 3

nums[3] = 3

nums[4] = 4

nums[5] = 5

The next comparison is: index 3 and 4. Meaning that comparison of index 2 and 3 has been skipped.

<em>This is so because of the way the if statement is constructed.</em>

3 0
3 years ago
Practice with CSS. a. Write the CSS for an HTML selector footer with the following characteristics: a light-blue background colo
Nitella [24]

Answer:

Explanation:

/*# represents ID selector

*/

#feature{

font-family: 'Arial';

font-size: 10px;

color: red;

background: white;

width: 80%;

filter: drop-shadow(30px 10px 4px #4444dd);

}

8 0
3 years ago
The celestial sphere is divided into
7nadin3 [17]

Answer:

A.

Explanation:

4 0
3 years ago
Read 2 more answers
Which option can you use to control how text flows around a graphic?
Art [367]

Answer:

I believe your answer is C: Wrap Text

Explanation:

If you are trying to put an image in a more specific placement you would use Wrap Text. It helps making the image more clear and understandable because without wrapping the text it wouldnt make any sense and it would just be plain.

Hope this helps

3 0
3 years ago
Read 2 more answers
Other questions:
  • Write a program that accepts as input the mass, in grams, and density, in grams per cubic centimeters, and outputs the volume of
    14·1 answer
  • When called upon to give an impromptu speech, it is a good idea to do all of the following, except:
    11·2 answers
  • E gpa(grade point average) you need to have or you get kicked out of robotics for middle school?
    13·1 answer
  • Shannon has been a member of her schools newpaper club for 2 years and attends writing workshops in her free time. Which career
    11·1 answer
  • Match the spreadsheet features with their respective descriptions.
    7·2 answers
  • Ive looked everywhere on brainly and we have no answers for computers and technology
    7·1 answer
  • Although “dog.jpg” and “dog.JPG” and “Dog.jpg” and “DOG.JPG” all appear to be the same file, they are not considered the same wh
    6·1 answer
  • Book information (overriding member methods) Given main() and a base Book class, define a derived class called Encyclopedia. Wit
    12·1 answer
  • What are the vitamins used for DNA Synthesis and Repair?​
    11·1 answer
  • Pls help help me is good help me helping is very good
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!