(1)对于下列图G的邻接矩阵,写出函数调用f32(&G,3)的返回值。(2)简述函数f32的功能。(3)写出函数f32的

(1)对于下列图G的邻接矩阵,写出函数调用f32(&G,3)的返回值。

(2)简述函数f32的功能。
(3)写出函数f32的时间复杂度。
int f32(MGraph *G,int i)
{int d=0,j;
for(j=0;j<G->n;j++)
{if(G->edges[i][j]) d++;
if(G->edges[j][i]) d++;
}
return d;
}


【正确答案】:【答案】(1)5
(2)求有向图顶点vi的出度和入度之和
(3)O(n)