#include <> #define INF 9999 void main( ) int cost[4][4] = { clrscr( ) ; for ( i = 0 ; i < n ; i++ ) arr[i][j] = INF ; else arr[i][j] = cost[i][j] ; printf ( "Adjacency matrix of cost of edges:\n" ) ; printf ( "%d\t", arr[i][j] ) ; printf ( "\n" ) ; for ( k = 0 ; k < n ; k++ ) arr[i][j] = arr[i][k] + arr[k][j]; printf ( “\nAdjacency matrix of lowest cost between the vertices:\n” ) ; printf ( “%d\t”, arr[i][j] ) ; printf ( “\n” ) ; getch( ) ;
#include <>
{
int arr[4][4] ;
7, 5, 0, 0,
7, 0, 0, 2,
0, 3, 0, 0,
4, 0, 1, 0
} ;
int i, j, k, n = 4 ;
{
for ( j = 0; j < n ; j++ )
{
if ( cost[i][j] == 0 )
}
}
for ( i = 0 ; i < n ; i++ )
{
for ( j = 0; j <>
}
{
for ( i = 0 ; i < n ; i++ )
{
for ( j = 0 ; j < n ; j++ )
{
if ( arr[i][j] > arr[i][k] + arr[k][j] )
}
}
}
for ( i = 0 ; i < n ; i++ )
{
for ( j = 0; j <>
}
}
Labels
- ajax (1)
- Assembly Programming (3)
- Books on C++ (6)
- C Programs (35)
- Challenging Question (1)
- Class (1)
- Complete Script (1)
- Computer Graphics (1)
- CSS (2)
- Datastructure (6)
- Download (3)
- e-books (8)
- Errors (1)
- FTP (2)
- HTML (3)
- Interview Questions (8)
- Introduction (1)
- Methods (2)
- OOP (1)
- Operator Overloading (1)
- Operators (1)
- Others (5)
- PHP (4)
- PHP Errors (1)
- PHP Script (1)
- Programming (3)
- Question Bank (6)
- Short Questions (1)
- SQL (1)
- Tips (1)
- Tricks (1)
- Tricky Programs in C (2)
- Useful Scripts (1)
- WAP (1)
- Web (3)
- XHTML (1)
Find the Shortest Path in C
Sunday, August 29, 2010Posted by Xofth at 10:38 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment