Question: Let's say you want to model a collection of Java files in a project. You know which files exists and which other Java files
Let's say you want to model a collection of Java files in a project. You know which files exists and which other Java files they depend on using. You want to determine the order that the files have to be complied in before a given file can be complied and run. What type of graph would you construct in order to create this model (i.e, directed vs. undirected, cyclic vs. acyclic)? What information do the nodes represent? What information do the edges represent? What information are you storing and how are you storing such information in your graph? How will you traverse your graph and create an efficient graph algorithm that returns files in the correct order such that all files can be compiled and run? Justify your answer by providing a worst-case runtime. Briefly describe your graph model and graph algorithm in no more than 5 sentences. Thank you!
Step by Step Solution
3.40 Rating (159 Votes )
There are 3 Steps involved in it
To model the compilation order of Java files in a project you would construct a directed acyclic gra... View full answer
Get step-by-step solutions from verified subject matter experts
