I'm not graduated from computer science. so I was hesitated that I could post article about algorithm???
No fear, Tried it.
and I posted fewer things.
I just believe that this is just start.
I plan to post more than 100 algorithm and testcase.
below is pseudocode from wikipedia
L ← Empty list that will contain the sorted elements S ← Set of all nodes with no incoming edges while S is non-empty do remove a node n from S add n to tail of L for each node m with an edge e from n to m do remove edge e from the graph if m has no other incoming edges then insert m into S if graph has edges then return error (graph has at least one cycle) else return L (a topologically sorted order)
1. make empty list or stack~
2. make Set of all nodes with no incoming edges.
- this means add Set if node has no parent node.
3. if set is not empty remove a node "n" from Set
4. add n to tail of List or stack
5. find n's destination nodes
6. remove edges destination nodes,
7. if nodes has no incoming edges insert S
print list or stack
later on I will write java code
if my code is show how stange. reply and discuss