Trying to figure out how to write this function...

I think it would have to be made a recursive or at least some kind of iterative function.

-You have a list of hypothetical tasks, each one ("i") with a given duration, let's say, "di" and a given list of tasks that must be completed before it.
-What I need to figure out is how to write a function that can calculate the soonest end time of a specific given task in the list, "i", let's say, denoted by "Di"

-The soonest end time of a task is computed by Di = max(Dk+dk), where "k" is all of the tasks that need to be completed before that one. The way the "max" function works, is that it adds up every task's duration and soonest end time and takes the biggest one.

I don't know. That's practically all I can even tell you. It should be able to be done easiest recursively, but I can't wrap my head around it. Any help is much appreciated.
You have to understand the problem before you can design a solution. You have not given enough information which suggests you don't understand the problem yet.
Topic archived. No new replies allowed.