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
yanalaym [24]
3 years ago
9

Which algorithm makes the most efficient use ofmemory?

Computers and Technology
1 answer:
SashulF [63]3 years ago
5 0

Answer:

Best-fit Algorithm

Explanation:

Best-fit: Allocating the smallest memory location that is greater than or equal to the size of process.

<u>Example</u>

Let these are the memory locations-210kb,310kb,260kb,610kb

                    and size of processes-160kb,450kb,250kb,300kb

For the first-fit,

We allocate 160 kb to the 210kb memory location

Then, we allocate 450 kb to the 610kb because others don't have the size.

Then,we allocate 250kb to the 310 kb.

300 kb will stop,as no memory locations can execute.

For the Best-fit,

We allocate 160 kb to the 210kb memory location

Then,we allocate 450kb to the 610kb.

Then,we allocate 250kb to the  260kb not 310kb according to best-fit.

Then we allocate 300kb to the 310kb.

For the worst fit,

We allocate 160 kb to the 610kb memory location according to the worst-fit algorithm.

Then,we can't allocate 450kb to any memory location.

Then,we allocate 250kb to the 310kb .

We can' allocate 300kb in 260kb memory location.

As we can see from this example that in First-fit algorithm 300kb process will stop as no memory location is there.

In worst-fit algorithm ,We can't allocate 450kb,300kb to any memory locations.

In Best-fit algorithm,we can allocate the process to each location,so this algorithm is using memory in a efficient way.    

You might be interested in
Optimal page replacement ______.A. is the page-replacement algorithm most often implementedB. is used mostly for comparison with
deff fn [24]

Answer:

A. Is the page-replacement algorithm most often implemented.

Explanation:

This algorithm is used when a page that is not present in memory is called, leading to the Operating System to replace one of the existing pages with the needed one. There are different replacing algorithms in order to decide which page will be replaced.

This algorithm is implemented to reduce the number of failures and provide a better funcionality and speed the process by discarding pages that won't be used for a long period of time.

8 0
3 years ago
Where are methods listed in a UML class diagram showing three parts?
denis23 [38]

Answer:

the bottom third

Explanation:

Check out the exampe below.

swim() would be an example of a method.

3 0
2 years ago
Write the document type declaration markup statement for an HTML5 file. Be sure to include the appropriate opening and closing b
GREYUIT [131]

Answer:

<!DOCTYPE html>

Explanation:

<!DOCTYPE html> is used in the HTML5. It is the document type declaration markup statement for an HTML5 file.

4 0
3 years ago
When did economies begin?
Pavlova-9 [17]
They began in ancient times the babylons started trading
6 0
3 years ago
Read 2 more answers
The intention of this problem is to analyze a user input word, and display the letter that it starts with (book → B).
yulyashka [42]

Answer:

Here is the C++ program:

#include<iostream>  // to use input output functions

using namespace std;     //to identify objects like cin cout

void StartChar(string str)  {  // function that takes a word string as parameter and returns the first letter of that word in capital

   int i;  

   char c;

   do  //start of do while loop

   {

   for (int i = 0; i < str.length(); i++) {  //iterates through each character of the word str

       if(str.length()>25){  //checks if the length of input word is greater than 25

           cout<<"limit exceeded"; }  //displays this message if a word is more than 25 characters long

      c = str.at(i);   // returns the character at position i

       if (! ( ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) ) ) {  //checks if the input word is contains characters other than the alphabet

            cout<<str<<" is not a word!"<<endl; break;}  //displays this message if user enters characters other than the alphabet

        if (i == 0) {  //check the first character of the input word

           str[i]=toupper(str[i]);  //converts the first character of the input word to uppercase

           cout<<str<<" starts with letter "<<str[i]<<endl;  }  // prints the letter that the word starts with in capital letter

   }   cout<<"Enter a word: ";  //prompts user to enter a word

      cin>>str;   //reads input word from user

}while(str!="#");   }    //keeps prompting user to enter a word until the user enters #

int main()   //start of the main() function body

{ string str;  //declares a variable to hold a word

cout<<"Enter a word: "; //prompts user to enter a word

cin>>str; //reads input word from user

   StartChar(str); }  //calls function passing the word to it

     

Explanation:

The program prompts the user to enter a word and then calls StartChar(str) method by passing the word to the function.

The function StartChar() takes that word string as argument.

do while loop starts. The for loop inside do while loop iterates through each character of the word string.

First if condition checks if the length of the input word is greater than 25 using length() method which returns the length of the str. For example user inputs "aaaaaaaaaaaaaaaaaaaaaaaaaaa". Then the message limit exceeded is printed on the screen if this if condition evaluates to true.

second if condition checks if the user enters anything except the alphabet character to form a  word. For example user $500. If this condition evaluates to true then the message $500 is not a word! is printed on the screen.

Third if condition checks if the first character of input word, convert that character to capital using toupper() method and prints the first letter of the str word in capital. For example if input word is "Computer" then this prints the message: Computer starts with the letter C in the output screen.

The program keeps prompting the user to enter the word until the user enters a hash # to end the program.

The output of the program is attached.

3 0
3 years ago
Other questions:
  • Information technology is the study of managing, processing, and retrieving information.
    5·1 answer
  • What is a valence orbit?
    13·2 answers
  • If you are working in a word-processing program and need to learn more about its features, the best place to get assistance is f
    7·2 answers
  • Generate the requested sets using only set builder notation and the provided sets. Some problems may require you to build one or
    15·1 answer
  • 1. The best program to present numerical data in would be ____. a. Access c. PowerPoint b. Excel d. Word
    6·1 answer
  • Within the try clause of a try statement, you code a. all the statements of the program b. a block of statements that might caus
    14·1 answer
  • PowerPoint provides a wide variety of predefined shapes that can add visual insert to a slide true or false
    10·2 answers
  • Why is it important to brain storm and develop concepts prior to selecting an idea that you wish to move forward with as a solut
    7·1 answer
  • When you open as many links as you want, and still stay in the same browser window instead of cluttering your screen with multip
    5·1 answer
  • Match the definitions of different business communication to the type of document
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!