I’m working on a c programming question and need a sample draft to help me learn.
Given a list of courses and their prerequisites, compute the order in which courses must be taken so that when taking a courses, all its prerequisites have already been taken.
All the files that the program would read from are in Unix format
You must create a directed graph corresponding to the data in the file.
- The graph will have as many vertices as different courses listed in the file.
- You can represent the vertices and edges however you want.
For each line in the file, the code can extract the first course and the prerequisites for it.
If you cannot process each line in the file correctly, you can use a modified input file that shows on each line, the number of courses, but you would lose the 15 points dedicated to line processing. If your program works with the “easy files”, in order to make it easy for the TAs to know which file to provide, please name your C program courses_graph_easy.c.