subject
Engineering, 06.05.2020 04:28 KeyesRaveen

Imagine that you are managing a supercomputer that runs jobs for your clients. A client can submit a set of computing jobs, numbered from 1 to n, and the dependencies among them. The dependencies are expressed as pairs. For example, (1, 2) means job 2 depends on job 1, i. e. job 2 can only start after job 1 finishes. Write a program that determines if it is possible to finish all the jobs without actually running them. Below are some example inputs and their expected outputs.

Input: number of jobs = 2, dependencies = [(1, 2)]
Output: true
Explanation: We can run job 1 first followed by job 2.
Input: number of jobs = 2, dependencies = [(1, 2), (2, 1)]
Output: false
Explanation: We need job 1 to finish before we can run job 2, and job 2 to finish before we can run job 1. It is clearly impossible.

Implement the method canFinish in job. h. In the written part of your answer, state and justify both the time and space complexity of your algorithm. Submit both the modified job. h file and the written complexity analysis.

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Adouble-strand no. 60 roller chain is used to transmit power between a 13-tooth driving sprocket rotating at 300 rev/min and a 52-tooth driven sprocket. a) what is the allowable horsepower of this drive? b) estimate the center-to-center distance if the chain length is 82 pitches. c) estimate the torque and bending force on the driving shaft by the chain if the actual horsepower transmitted is 30 percent less than the corrected (allowable) power.
Answers: 3
question
Engineering, 04.07.2019 18:10
Determine whether or not it is possible to compress air adiabatically from k to 140 kpa and 400 k. what is the entropy change during this process?
Answers: 3
question
Engineering, 04.07.2019 19:10
What is a monomer? how do they form a ploymer from the view point of chemical bonding?
Answers: 1
question
Engineering, 04.07.2019 19:10
Analyze the factors that influence the choice between the following pairs of processes to make the products indicated: i) sand casting versus die casting of an electric-motor housing ii) thread rolling versus machining of a bolt for high-strength application. (co3/c5)
Answers: 3
You know the right answer?
Imagine that you are managing a supercomputer that runs jobs for your clients. A client can submit a...
Questions
question
English, 03.09.2021 17:20
question
Mathematics, 03.09.2021 17:20
question
Mathematics, 03.09.2021 17:20
question
Mathematics, 03.09.2021 17:20
Questions on the website: 13722367