Hello, I need implement topological sort. I found info about this type of sorting on http://en.wikipedia.org/wiki/Topological_sort I write something like (code below). But I can't test it . According to wiki I get error that my graph is not a DAG, so a topological sort is impossible My code below, Please with what input test it. Thanks.
If you reverse your output youv'e got a correct solution :-) (congrats)
Now just work through your algorithm (like how you are adding and removing from the queue) and how you are building your solution and you should see where you have it backwards. [ January 19, 2007: Message edited by: Steve Fahlbusch ]