申論題內容
8. (10%) In an undirected graph G(V, E) with n vertices, these is an integer data di in each vertex v. Given a starting vertex S in the vertex set V, write an algorithm that computes the sum of associated data di's of all reachable vertices in V from S. (i.e. A reachable vertex T from the vertex S is a vertex that has a path from S to T.)