answersLogoWhite

0

What else can I help you with?

Related Questions

Where was Christmas t j max commercial filmed?

Mall of America


Did t j bell replace max green in escape the fate?

No, Max Green is still in Escape the Fate.


What is a store name starting with the letter t?

TalbotTiffany & CoTargetT. J. Max


What has the author J T Fraser written?

J. T. Fraser has written: 'Voices of time'


The time that Canadian tire closes?

The ones in BC all close a t 9.00


How do you write a c program for Djikstra's shortest path algorithm?

#include<stdio.h> #include<conio.h> #include<string.h> #define MAX 20 void dijkstra(int adj_matrix[MAX][MAX],int total, int startnode,int destnode,char location[MAX][MAX]) { int cost[MAX][MAX],distance[MAX],pred[MAX]; int visited[MAX],count,mindistance,nextnode,i,j; const int INFINITY = 9999; for(i=0;i<total;i++) { for(j=0;j<total;j++) { if(adj_matrix[i][j]==0) cost[i][j]=INFINITY; else cost[i][j]=adj_matrix[i][j]; } } for(i=0;i<total;i++) { distance[i]=cost[startnode][i]; pred[i]=startnode; visited[i]=0; } distance[startnode]=0; visited[startnode]=1; count=1; while(count<total-1) { mindistance=INFINITY ; for(i=0;i<total;i++) { if(distance[i] < mindistance && !visited[i]) { mindistance=distance[i]; nextnode=i; } } visited[nextnode]=1; for(i=0;i<total;i++) { if(!visited[i]) { if(mindistance+cost[nextnode][i]<distance[i]) { distance[i]=mindistance+cost[nextnode][i]; pred[i]=nextnode; } } } count++; } printf("\nShortest Distance from %s to %s = %d units\n",location[startnode],location[destnode],distance[destnode]); printf("\nPath = %s",location[destnode]); j=destnode; do { j=pred[j]; printf(" <- %s",location[j]); }while(j!=startnode); } int search(char source[MAX][MAX],char string[MAX]) { int i; for(i=0;i<MAX;i++) { if(stricmp(source[i],string)==0) return i; } return -1; } void main() { char location[MAX][MAX],start[MAX],dest[MAX]; int total,i,j,adj_matrix[MAX][MAX]; clrscr(); printf("\nEnter the number of locations you are going to enter\t"); scanf("%d",&total); printf("\nEnter the name for %d locations...\n",total); for(i=0;i<total;i++) { printf("\nLocation %d ==> ",i); scanf("%s",location[i]); } for(i=0;i<total;i++) { j=i; while(j<total) { if(i==j) { adj_matrix[i][j]=0; } else { printf("\nEnter distance from %s to %s\t",location[i],location[j]); scanf("%d",&adj_matrix[i][j]); adj_matrix[j][i] = adj_matrix[i][j]; } j++; } } printf("\nEnter starting location\t"); scanf("%s",start); i = search(location,start); printf("\nEnter destination location\t"); scanf("%s",dest); j = search(location,dest); if(i==-1) printf("\nInvalid Starting Location Entered..."); else if(j==-1) printf("\nInvalid Destination Location Entered..."); else dijkstra(adj_matrix,total,i,j,location); getch(); } Written by: Fabianski Benjamin


When was T-Max created?

T-Max was created in 2007.


How old is J. T. Hearne?

J. T. Hearne was born on May 3, 1867 and died on April 17, 1944. J. T. Hearne would have been 76 years old at the time of death or 148 years old today.


What planet closes t in the sun?

Mercury is closest to the Sun


What are the release dates for A-J-'s Time Travelers - 1995 P-T- Barnum 1-26?

A-J-'s Time Travelers - 1995 P-T- Barnum 1-26 was released on: USA: 1995


What does the t j in t j maxx stand for?

Toe jam


When was Max T. Barnes born?

Max T. Barnes was born on 1962-10-25.