Engineering
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.

answer
Answers: 3

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, settasav9641
Abrake has a normal braking torque of 2.8 kip in and heat-dissipating cast-iron surfaces whose mass is 40 lbm. suppose a load is brought to rest in 8.0 s from an initial angular speed of 1600 rev/min using the normal braking torque; estimate the temperature rise of the heat dissipating surfaces.
Answers: 3
image
Engineering, 04.07.2019 18:10, yasminothman02
An air conditioning system consist of a 5 cm diameter pipe, operating at a pressure of 200 kpa. the air initially enters the pipe at 15°c with a velocity of 20 m/s and relative humidity of 80%. if the heat supply throughout the process is 960 w, determine the relative humidity and the temperature at the outlet
Answers: 3
image
Engineering, 04.07.2019 18:10, bunnles
During a steady flow process, the change of energy with respect to time is zero. a)- true b)- false
Answers: 2
image
Engineering, 04.07.2019 18:10, kevin72836
Consider a large isothermal enclosure that is maintained at a uniform temperature of 2000 k. calculate the emissive power of the radiation that emerges from a small aperture on the enclosure surface. what is the wavelength ? , below which 10% of the emission is concentrated? what is the wavelength ? 2 above which 10% of the emission is concentrated? determine the wavelength at which maximum spectral emissive power occurs. what is the irradiation incident on a small object placed inside the enclosure?
Answers: 2
Do you know the correct answer?
Imagine that you are managing a supercomputer that runs jobs for your clients. A client can submit a...

Questions in other subjects:

Konu
English, 11.01.2020 10:31