COMP 2521 - Ass 2 : Faq

Should the return value of outIncident() and inIncident() be a copy of the AdjList stored in the graph, or a direct pointer to the list in the graph representation?

Both have their advantages and disadvantages but because our program will be calling this function once every single node in a graph multiple times, going with the faster option would be a good idea. Obviously this would be to return a direct pointer. Since no function ever needs to edit the graph, only read from it, this would work fine. On the same vain think about how you could optimise inIncident to also return a pointer.

My order is incorrect for the pred array

Order in pred array linked list does not matter. For marking, we will order before comparing, so it should be fine. :D

Can I change PQ.h, Graph.h

Nah sorry, i know it would make life easier if you could just edit the file but we want to enforce a interface. Think about how you could build your data structure with the .h file in mind. We may use alternative implementations of Graph.c and PQ.c !