subject
Computers and Technology, 08.10.2019 06:00 sggg497

There are some processes that need to be executed. amount of a load that process causes on a server that runs it, is being represented by a single integer. total load caused on a server is the sum of the loads of all the processes that run on that server. you have at your disposal two servers, on which mentioned processes can be run, your goal is to distribute given processes between those two servers in the way that, absolute difference of their loads will be minimized. write a function: class solution { public int solution(int[] a); } (java) that, given an array of a of n integers, of which represents loads caused by successive processes, the function should return the minimum absolute difference of server loads. for example, given array a such that:

a[0] = 1
a[1] = 2
a[2] = 3
a[3] = 4
a[4] = 5

your function should return 1. we can distribute the processes with loads 1,2,3,4 to the first server and 3,5 to the second one, so that their total loads will be 7 and 8, respectively, and the difference of their loads will be equal to 1.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
Aconstruction company is creating a powerpoint presentation describing how they calculate costs during each construction step. they plan to email this presentation to clients. the individual clients will be watching the presentation slide show on their own personal computers. what is the most important formatting step the company should take to make the text readable and pleasing to the eye?
Answers: 2
question
Computers and Technology, 23.06.2019 07:00
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
For which utilities, if any, does the landlord pay?
Answers: 2
question
Computers and Technology, 24.06.2019 11:20
Every telecommunication setup uses two devices: one device to transmit data and one device to receive data. which device transmits frequencies to mobile phones? towers transmit frequencies to mobile phones.
Answers: 1
You know the right answer?
There are some processes that need to be executed. amount of a load that process causes on a server...
Questions
question
Computers and Technology, 22.08.2019 18:30
question
Social Studies, 22.08.2019 18:40
Questions on the website: 13722363