does anybody know where can i find the source code for prim algorithm.or can u help me with the code
i know how floyd's algorithm works
i think they are similar but i dont know how to do itCode:void floyd2(int n, long W[5][5], long D[5][5], long P[5][5])
{
int i,j,k;
for(i = 1;i <= n;i++)
for(j = 1; j <= n;j++)
P[i][j] = 0;
D = W;
for(k = 1;k <= n;k++)
for(i = 1;i <=n;i++)
for(j = 1;j <= n;j++)
if(D[i][k] + D[k][j] < D[i][j]) {
P[i][j] = k;
D[i][j] = D[i][k] + D[k][j];
}
}