V1.6.0 java question of 19.4 Deadlock Detection

#1

I have a question on the solution. Why do we need to use pre and cur ? In the solution’s algorithm, it won’t detect a cycle of the following example. A->B, B->A.

0 Likes

#2

Hey @Pete,

Thanks for the question, and there are other few readers have similar question. You are right that pre is only needed for undirected graph. I have removed that and modified the code.

0 Likes