SPOJ-TOPOSORT — getting WA

Revision en1, by vohrab1896, 2020-08-28 15:34:58

Hi all

I am getting WA in SPOJ-TOPOSORT. I solved it using Kahn's Algorithm but getting WA. To get smallest value on second place I am picking up smallest value from the child nodes of the node present at the front of queue and then comparing it's value to other value present in the front of queue. This is the link- [https://ideone.com/Yur2cr]. I have given a lot of time to find the wrong test case but failed. If anyone is able to solve this then please let me know.

Thanks

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English vohrab1896 2020-08-28 15:34:58 511 Initial revision (published)