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
In python, sorry if it’s blurry
stepan [7]

Answer:

nice

Explanation:

3 0
2 years ago
Read 2 more answers
A usability study compares the number of page visits on a web site. Half of the participants saw Version A of the home page. The
USPshnik [31]

Answer:

d. A web analytic

Explanation:

Web analytic measure activity and behavior of a user on a website, for example: how many users visit, how long they stay, how many pages they visit, which pages they visit, and whether they arrive by following a link or not.

Ordinal data is a categorical, statistical data type where the variables have natural, ordered categories and the distances between the categories is not known.

Dependent variable rely on another variable to get a value

Independent variable are variable which can be gotten on their own without relying on another variable.

7 0
3 years ago
Company A has a project plan for a new product under development. The product will be one of many released in the coming year. T
gizmo_the_mogwai [7]

Answer:

Company A

The ISO 27002 classification level that is most likely assigned to this document is:

b) Proprietary

Explanation:

The ISO 27002 classification levels adopted by commercial organizations are Restricted (top secret is preferred in government circles), Confidential, Internal (or proprietary), and Public. Since the new product is under development, one of many, and most likely known to the project team, the project plan will be classified as Proprietary.  Company A designates this document as Proprietary or Internal to show that disclosure of the information to its competitors is not allowed.  This level of classification shows that Company A can establish intellectual property rights over the document.

4 0
3 years ago
What would you need to have on your foley stage
LUCKY_DIMON [66]
<span>You will need many props for your Specific tracks (whatever you see in the film!). It's impossible to say what you will need until you see the picture and as time goes by you will add to your collection (if you have space!) - garbage day in my neighborhood is 'golden day' as I collect some of best props from the stuff people throw out: old bicycles, doors, sinks, wood, metal, desks, etc.</span>
4 0
3 years ago
How do you change a LAN (local area network) to a WAN (wide-area network)
ahrayia [7]

Answer:

Go to internet, click use as LAN under the cable section and click yes to confirm

4 0
3 years ago
Other questions:
  • A good first step to understanding any kind of text is to :
    6·1 answer
  • Which building-block feature is available in the Text grouping on the Insert tab?
    14·1 answer
  • Assume that a gallon of paint covers about 350 square feet of wall space. Create anapplication with a main() method that prompts
    5·1 answer
  • Multiply 1101 and 0110 in binary.
    10·1 answer
  • You buy a new workstation that features an embedded RAID controller on the motherboard. You want to setup hardware RAID 10. How
    10·2 answers
  • A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: The name of the clie
    8·1 answer
  • HELP ME?!!?!?!?!?!?
    9·2 answers
  • The memory used by the CPU to temporarily hold data while processing is called _______. random access memory central processing
    5·1 answer
  • How to clear a function in functional component react.
    6·1 answer
  • Convert<br> 0.625 to binary
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!