Skip to content

Latest commit

 

History

History
19 lines (17 loc) · 395 Bytes

README.md

File metadata and controls

19 lines (17 loc) · 395 Bytes

Topological sorter

Input: a directed graph

Enter an edge, eg.: A->B
a->b
Enter an edge, eg.: A->B
b->c
Enter an edge, eg.: A->B
j->a
Enter an edge, eg.: A->B
 # blank line to finish 

Output: an ordered list

Directed graph constructed.                                                                                            
Topologically sorted:  ['j', 'a', 'b', 'c']