DAA LAB

Program to find all pairs shortest path using Floyd’s Algorithm

Program #include <stdio.h> #include <conio.h> void floyd(int [10][10], int); int min(int, int); void main() { int n, a[10][10], i, j; printf(“****************************************************************”); printf(“\n****************************************************************”); printf(“\n** WAP to find shortest path between any two pairs of nodes **”); printf(“\n** using Floyd Warshall’s Algorithm in C **”); printf(“\n** Created by Sheetal Garg **”); printf(“\n** Assistant Professor **”); printf(“\n** Phone …

Program to find all pairs shortest path using Floyd’s Algorithm Read More »

Program to check whether a graph is connected or not using DFS method

Program: #include<stdio.h> void DFS(int[20][20], int, int[20], int); int main() { int n, a[20][20], i, j, visited[20], source; printf(“****************************************************************”); printf(“\n****************************************************************”); printf(“\n** Program for Depth First Search in C **”); printf(“\n** Created by Sheetal Garg **”); printf(“\n** Assistant Professor **”); printf(“\n** Phone No:9467863365 **”); printf(“\n****************************************************************”); printf(“\n****************************************************************”); printf(“\nEnter the number of vertices: “); scanf(“%d”, &n); printf(“\nEnter the adjacency …

Program to check whether a graph is connected or not using DFS method Read More »

error: You can only copy the programs code and output from this website. You are not allowed to copy anything else.