Write a program for topological ordering of a graph. The input to your program is a directed acyclic graph in its adjacency list format (for any vertex only ingoing edges are stored). The output is a topological ordering of the graph. Your program (which should run on CSE machines) should read from the file data4.txt and write to the file out4.txt. As usual (referring to assignment 1) include a read me file containing all needed information. For this assignment the input files contain only one graph. Each line of input file starts with name of a vertex followed by name of vertices that are adjacent to that vertex (separated by spaces). For this assignment you cannot use any graph structure form STL, but you can use vectors and strings.

Example input

1 3 4
2 1
3
4
5 1 2

Example output

Topological ordering is: 3, 4, 1, 2, 5
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.