Thank you for your article. You explained as well, however your implementation may have some problems. I didn't run your code but I guess that it will not be able to work as expected. For example:
line 20 and line 37, the keyword int
for(inti=0;i<indegree.length;i++){
line 35, visited is Set, not Array, so you have to use add(), not push()
Thank you for your article. You explained as well, however your implementation may have some problems. I didn't run your code but I guess that it will not be able to work as expected. For example:
int
visited
is Set, not Array, so you have to useadd()
, notpush()
Please check and fix them :)
Omg, thanks for pointing out! Code updated :)