#include<stdio.h>
#include<conio.h>
#include<string.h>
void min(int[],int,int[][],int);
void main()
{
int s[20][20],i,j,n,ne[20][20],k=0,d[20],z[20][2],e[20];
char nam[20],r;
clrscr();
printf("enter no.of routers in the subnet:");
scanf("%d",&n);
printf("Enter the adjacency matrix\n");
for(i=0;i<n;i++)
for(j=0;j<n;j++)
scanf("%d",&s[i][j]);
printf("Which routers routing table you want to construct:");
scanf(%c",&r);
printf("the neighbours of c are:",r);
for(i=0;i<n;i++)
if(s[r-65][i]==1)
{
printf("%c",i+65);
nam[k++]=i+65;
}
printf("\n");
for(i=0;i<k;i++)
{
printf("Enter %c%c delay:",r,nam[i]);
scanf("%d",&d[i]);
}
for(i=0;i<k;i++)
{
printf("\n Enter %c's routing table \n",nam[i]);
for(j=0;j<n;j++)
scanf("%d",&ne[i][j];
}
for(i=0;i<n;i++)
{
for(j=0;j<k;j++)
e[j]=ne[i][j]+d[j];
min(e,k,z,i);
}
clrscr();
printf("To");
for(i=0;i<k;i++)
printf("%c\t",nam[i]);
printf("NEW TABLE FOR %c ",r);
printf("\n");
for(i=0;i<k;i++)
printf("......");
printf("..............");
for(i=0;i<n;i++)
{
printf("\n");
printf("%c|",i+65);
for(j=0;j<k;j++)
printf("%d\t",ne[j][i]);
if(r==(i+65))
printf("0\t-);
else
{
printf("%d\t",z[i][0]);
printf("%c\t",nam[z[i][1]]);
}
}
}
void min(int e[20],int k,int z[20][2],int i)
{
int b;
z[i][0]=e[0];
z[i][1]=0;
for(b=1;b<k;b++)
if(e[b]<z[i][0])
{
z[i][1]=0;
for(b=1;b<k;b++)
if(e[b]<z[i][0])
{
z[i][0]=e[b];
z[i][1]=b;
}
}
A speed measurement indicating the distance traveled in an hour.
An example of finiteness in algorithm is when a loop within the algorithm has a predetermined number of iterations, meaning it will only run a specific number of times before completing. This ensures that the algorithm will eventually terminate and not run indefinitely.
fdf
Distance between speakers
There is not "a" greedy algorithm; "greedy algorithm" is a term to describe several algorithms that have some things in common. The general idea is that at each step, you look for what seems to be, "locally", the best solution. For example, in a shortest-distance problem, look for a step that takes you closer to the destination. This may, or may not, lead to the best solution overall.
If you mean "Algorithm" an algorithm is simply a set of rules, or steps to complete, which are needed to solve a particular problem. An example would be a recipe in a cookbook. A recipe is an algorithm.
It is 28 (for example km)
distance between speakers (apex )
An example of wavelength is the distance between two consecutive peaks of a wave, such as the distance between two successive crests of an ocean wave or two peaks of a sound wave. In electromagnetic radiation, the wavelength is the distance between two successive peaks of the wave, like the distance between two peaks of a light wave.
Distance is a scalar quantity that measures the amount of space between two points. It only represents the magnitude of separation without indicating the direction of travel. In contrast, displacement is a vector quantity that includes both distance and direction.
4d + 7 = -15
The distance between New York and Missouri varies depending on the cities you are traveling between. For example, the distance between New York City and St. Louis, Missouri is approximately 875 miles.