SkienaBook / Algorithm-Design-Manual-Programs-V3

Programs for the third edition of the Algorithm Design Manual
Other
124 stars 29 forks source link

Slight logical difference between psuedo code and C code in DFS #5

Open Vyom-Yadav opened 1 year ago

Vyom-Yadav commented 1 year ago

In DFS: https://github.com/SkienaBook/Algorithm-Design-Manual-Programs-V3/blob/9bdfcc0203956c354cfc9715559a8671a73684cb/bfs-dfs.c#L143-L144

time is incremented and then added to exit_time array.

But in Psuedo Code on page 221:

exit[u] = time
time = time + 1

20230829_231818.jpg

The problem of how many descendants can be still solved, but this looks odd and buggy.

Thoughts @SkienaBook Sir?