#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;
}
}
I've never heard the term "finiteness" applied to an algorithm, but I think that's because the definition of an algorithm includes that it must be finite. So think of any algorithm and there is your example of finiteness.
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.
It is 28 (for example km)
distance between speakers (apex )
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.
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.
4d + 7 = -15
A declination is a term used in astronomy to describe the angular distance of a celestial object from the celestial equator. For example, the declination of the star Sirius is approximately -16.7 degrees, indicating its position relative to the celestial equator.
design an algorithm for finding all the factors of a positive integer
The gravitational force between the Earth and sun certainly depends on the distance between the Earth and sun. But the gravitational force between, for example, the Earth and me does not.