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
Readme [11.4K]
2 years ago
11

A computing company is running a set of processes every day. Each process has its own start time and finish time, during which i

t runs continuously. The company has developed a process_check module, that runs briefly (consider this to take just 1 point in time) and records important pieces of information about the processes running at that time. The company would like to run the process_check module as few times as possible each day, while making sure that the module is called at least once during the execution of each process.
Required:

Give an efficient algorithm that based on the start and finish time of each process will find the smallest set of possible moments of time at which to run the process_check module (making sure that the module is invoked at least once for each process).
Computers and Technology
1 answer:
Helga [31]2 years ago
5 0

Answer:

Above all else, let us show that this issue has the greedy choice property.

This implies that worldwide ideal arrangement can be gotten by choosing local ideal arrangements. Presently notice the following:

The global optimal solution of the issue requests us to track down the minimum number of times process_check module should be run.

It is likewise referenced that during each running interaction, process_check module should be called atleast once. Along these lines, the minimum possible number of process_check calls happens when process_check is made close to the quantity of the processes that are run.

Along these lines, we see that the global optimal solution is shaped by choosing optimal answer for the nearby advances.

Along these lines, the issue shows greedy choice property. Thus, we can utilize a greedy algorithm for this issue.

The greedy step in this calculation is to postpone the process_check as far as might be feasible. Thus, it should be run towards the finish of each interaction. So the following algorithm can be utilized:

Sort the cycles by utilizing the completion times.

Towards the finish of the 1st process in the arranged list, run the process_check module. Right now any process that is now running is removed the arranged rundown. The main interaction is additionally removed from the sorted list.

Now repeat stage 2, till all processes are finished.

In the above mentioned algorithm, the costliest advance is the step of sorting. By utilizing the optimal sorting algorithm, for example, merge sort, we can achieve it in O(n log n) asymptotic time.

Along these lines, this greedy algorithm additionally takes O(n log n) asymptotic time complexity.

You might be interested in
Use ________ resolution when recording human speech in an audio file.
Reil [10]
<span>Use 8-bit resolution when recording human speech in an audio file.
</span><span>The </span>resolution<span> of </span>8 bits<span> can encode an analog input to one in 256 different levels. The reason why 256 levels is because 2^8</span><span> = 256.
</span>The analog to digital converter (ADC) <span> represents the analog input as a digital word.</span>
6 0
3 years ago
Write a cash register program that calculates change for a restaurant of your choice. Your program should include: Ask the user
eduard

Answer:

Python Code

Explanation:

total = 0.0

change = 0.0

itemone = float(input("Enter the first price: "))

itemtwo = float(input("Enter the second price: "))

itemthree = float(input("Enter the third price: "))

total = itemone + itemtwo + itemthree

print("Total:", total)

cash = float(input("Cash given: "))

change = total - cash

print("Your change:", change)

4 0
2 years ago
Write a program that creates a two-dimensional array named height and stores the following data:
antiseptic1488 [7]

Answer:

Explanation:

The following code is written in Java and it simply creates the 2-Dimensional int array with the data provided and then uses the Arrays class to easily print the entire array's data in each layer.

import java.util.Arrays;

class Brainly {

   public static void main(String[] args) {

       int[][] arr = {{16, 17, 14}, {17, 18, 17}, {15, 17, 14}};

   

     

      System.out.print(Arrays./*Remove this because brainly detects as swearword*/deepToString(arr));

   }

}

4 0
2 years ago
Read 2 more answers
Which statement is true about dynamic microphones?
Xelga [282]

Answer:

b they have high sensitivity to surrounding sound

Explanation:

tell me it's correct or not

if it's correct so I hope it is helpful for you

but no so I am sorry

6 0
2 years ago
Read 2 more answers
A function checkZeros accepts three double parameters. It checks to see if the sum of all three parameters is equal to zero. If
blagie [28]

Answer:

Explanation:

The following code is written in Java. It creates the interface/prototype, the function, and the main method call. The function takes in the three int parameters, adds them, and then checks if the sum equals zero, outputting the correct boolean value. Output can be seen in the picture attached below. Due to technical difficulties I had to add the code as a txt file below.

6 0
2 years ago
Other questions:
  • Write the getNumGoodReviews method, which returns the number of good reviews for a given product name. A review is considered go
    14·1 answer
  • What is malware short for?
    13·2 answers
  • You can leave out the ____ statements in a switch structure.
    15·1 answer
  • Security awareness training can reduce the risk of a data breach by what percentage?
    12·1 answer
  • Antivirus software installed to scan and monitor malware activities on a server or workstation would be identified as a ________
    8·1 answer
  • assume that you want to sort an array have 100000 elements which algorithm (insert sort algorithm or quick sort algorithm) is th
    12·1 answer
  • Seth is researching new developments in cancer treatments. Which suggestion would be most beneficial to making sure his search r
    14·1 answer
  • 8.7 lesson practice question 1
    13·1 answer
  • How to automatically forward text messages to another phone iphone.
    10·1 answer
  • what component of virtualization controls all physical memory, and thus has the ability to make any unused memory pages in each
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!