阿摩線上測驗 登入

申論題資訊

試卷:102年 - 102 國立交通大學_碩士班考試入學試題_資訊聯招:資料結構與演算法#113274
科目:交大◆資工◆資料結構與演算法
年份:102年
排序:0

申論題內容

10. (5%) Figure 7 presents the code for computing the number of connected components in an undirected graph. In the code, the undirected graph is stored in the form of adjacency lists. The graph has N vertices, which correspond to vert ices [N] at Line 25. Each vertex is a tVertex structure as given at Line 9~20. The function ConnectUndirected (v1, v2) is used for creating an undirected edge between vertex v1 and vertex V2. The function NumberOfComponents ( ) at Line 36 will return the number of connected components in the graph.
 Please complete the code by filling the blanks in Figure 7. There are a total of three blanks at Line 30,32, and 43 to be filled.
In the following problem 1 1-15, til in the blanks. Please try to keep all t u answers on the same sheet of the answer book. Each problem is worth 5 points. No partial credit will be given for only one correct blank. However you do not have to provide any justification.

63f490b772c4f.jpg