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
rusak2 [61]
3 years ago
15

Write a function that, given an array A of N integers, of which represents loads caused by successive processes, the function sh

ould return the minimum absolute difference of server loads.
Computers and Technology
1 answer:
Papessa [141]3 years ago
6 0

Answer:

// here is code in c++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{ // variable to store number of loads

   int n;

   cout<<"enter the number of servers:";

   // read the number of servers

   cin>>n;

   // create an integer array of servers of size n

   int server_load[n];

   // read the load of each server

   cout<<"enter the loads on each server:"<<endl;

   for(int x=0;x<n;x++)

   {

       cin>>server_load[x];

   }

   // sort the array

   sort(server_load,server_load+n);

   int min_diff=MAX_INT;

   // find the minimum absolute difference between the server load

   for(int y=0;y<n-1;y++)

   {

       int d=server_load[y+1]- server_load[y];

       if(d<min_diff)

       min_diff=d;

       

   }

   // print the minimum difference

   cout<<"minimum absolute difference of server load is: "<<min_diff<<endl;

return 0;

}

Explanation:

Read the number of servers from user and assign it to "n".Create an integer Array of size n to store the load on each server.Read the load of each server and store  in the array. Sort the array. Then find the minimum difference between two load of servers. Print the minimum difference.

Output:

enter the number of servers:6                                                                                              

enter the loads on each server:                                                                                            

12 45 5 9 3 24                                                                                                            

minimum absolute difference of server load is: 2

You might be interested in
_________ is the primary measurement used to gauge your typing ability
Reil [10]

Answer:

Words per minute

Explanation:

5 0
3 years ago
For each problem listed below, use the drop-down menu to select the field of the professional who can help solve the issue.
Lapatulllka [165]

Answer:

An employee is having trouble opening a file on a computer.

  • → ✔ <u>information services and support</u>

The president of a company wants to give the company website a fresh new look.

  • → ✔ <u>interactive media</u>

An employee wants to work from home but can’t connect to the network from there.

  • → ✔ <u>network systems administration</u>

The vice president of sales would like help designing a new software program to keep track of sales.

  • → ✔<u> programming and software development</u>

<u>OAmalOHopeO</u>

5 0
2 years ago
Read 2 more answers
How can edge computing be used to increase sustainability
nika2105 [10]

Edge computing be used to increase sustainability With Edge Computing the number of records traversing the network can be reduced greatly, freeing up bandwidth.

<h3>How is part computing sustainable?</h3>

Data centers devour an expected 2 hundred terawatt-hours (TWh) of power every year–extra than the power intake of a few countries. They additionally produce an expected 2% of all worldwide CO2 emissions. Edge Computing reduces network site visitors and records centre usage.

Data centres devour an expected 200 terawatt-hours (TWh) of power every year–extra than the power intake of a few countries. They additionally produce an expected 2% of all worldwide CO2 emissions.

Read more about the sustainability:

brainly.com/question/25350238

#SPJ1

4 0
2 years ago
The modulus ( % ) actually gives you the ___________ of an integer division problem.
Svetlanka [38]
The answer is (e) sum
7 0
3 years ago
List and describe 3 parts (often referred to as 'elements') of a web page?
Art [367]

Answer:

Content

Design

Development

Explanation:

The design and management of sites is internet explorer; it is the research that takes place over time to make a site look fantastic, work quickly and function well with a smooth user interface.

7 0
3 years ago
Other questions:
  • When a relationship is established between two or more arrays by using the same subscript to relate entries between the arrays,
    14·2 answers
  • Software (often on firmware) designed to make physical products and devices "smarter" by doing things like sharing usage informa
    12·1 answer
  • What is the accounting equation?
    12·1 answer
  • What is the difference between a fragment shader and vertex shader? How do they relate?
    8·1 answer
  • 2. What type of expansion card allows your computer to
    12·1 answer
  • Write a Twitter class that sets the Twitter user first (who is to be followed) and lets the client add up to 5 followers, which
    10·1 answer
  • What can provides access to the only menu in office 2007​
    13·1 answer
  • Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with a
    10·1 answer
  • Reading (BCK FORM 2C IT 2020-2021)
    12·2 answers
  • Name any three areas of of application of excel.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!