vohrab1896's blog

By vohrab1896, history, 4 years ago, In English

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

  • Vote: I like it
  • 0
  • Vote: I do not like it