Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
<pre lang="cs">public class Activity {
    private string id;
    private string description;
    private int duration;
    private int est;
    private int lst;
    private int eet;
    private int let;
    private Activity[] successors;
    private Activity[] predecessors;
}
///////////////////////////////////////////////////
private static Activity[] WalkListAback(Activity[] list)
    {
        list[na - 1].Let = list[na - 1].Eet;
        list[na - 1].Lst = list[na - 1].Let - list[na - 1].Duration;

        for(int i = na - 2; i &gt;= 0; i--)
        {
            foreach(Activity activity in list[i].Successors)
            {
              if(list[i].Let == 0)
                list[i].Let = activity.Lst;
              else
                if(list[i].Let &gt; activity.Lst)
                  list[i].Let = activity.Lst;
            }

            list[i].Lst = list[i].Let - list[i].Duration;
        }
        return list;
    }
</pre>
Posted
Comments
BillWoodruff 3-Oct-15 5:10am    
What is stopping you from running the code with break-points set, and observing what the code is doing, what the current state of variables is, etc. at each break-point ?

Do you have any idea how much work explaining code line by line is?
Every single line needs a paragraph of explanation! For example:
int next = r.Next();

Create a new variable called "next" which can hold a integer value. From the previously declared Random instance "r", call the "Next" method to get a new random number, and assign it to the "next" variable.

Can you imagine how long it would take us to explain even a very short code fragment like your example, line by line?

No. It is not going to happen. If you have a specific problem, then ask a question about it. But think first - would you want to sit down for 45 minutes and type up a line-by-line description for no good reason?

So no - go back to wherever you found the code, and ask there.
 
Share this answer
 
It is almost impossible to answer your question because you didn't gave us the context, there is no sample data.

The only practical thing to do is to use a debugger to see what the code is doing.
The Debugger allow you to run the code step by step and inspect variables as the code is running.

For now, the best clue your gave us is the function name WalkListAback
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900