Академический Документы
Профессиональный Документы
Культура Документы
{
if(i!=y)
{
j=1;
min=dt[i][j]+d[j];
mini=j;
for(j=2;j<=q;j++)
{
if(min>(dt[i][j]+d[j]))
{
min=dt[i][j]+d[j];
mini=j;
}
}
nd[i]=min;
l[i]=n[mini];
}
}
printf(" routing vector table for %c is\n",x);
for(i=1;i<=p;i++)
{
printf("%d\t%c\n",nd[i],l[i]);
}
getch();
}
OUTPUT:
Enter number of nodes: 5
Enter nodes:
A
B
C
D
E
Enter node for which you want to calculate routing table: A
Enter number of neighbours are there for A nod: 4
Enter neighbours of A node
B
C
D
E
Enter delays table
2
5
8
4
8
5
4
2
6
1
3
4
2
3
5
4
5
9
2
7
Enter delay from A to each of its neighbour
5
8
4
6
routing vector table for A is
0 8 D
7 D
7 B
6 D