Documentos de Académico
Documentos de Profesional
Documentos de Cultura
#include <stdio.h>
#include <conio.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
struct node
{
int num ;
struct node * link ;
} ;
void main( )
{
int numv , ch ;
int i ,x , y ;
clrscr( ) ;
while ( 1 )
{
clrscr( ) ;
printf ( "\n\t\tDictionary\n" ) ;
printf ( "\n\t\t1.Add Node to the graph.\n" ) ;
printf ( "\n\t\t2.Add Edge to the graph.\n" ) ;
printf ( "\n\t\t3.Delete Node from the graph.\n" ) ;
printf ( "\n\t\t4.Delete Edge from the graph.\n" ) ;
printf ( "\t\t5.Show Dictionary.\n" ) ;
printf ( "\t\t0.Exit." ) ;
printf ( "\n\n\t\tYour Choice ") ;
scanf ( "%d", &ch ) ;
switch ( ch )
{
case 1 :
case 2 :
case 3 :
printf ( "\nEnter parent node to be deleted from Graph :
%d" ) ;
scanf("%d",&p);
delvertex(int vertex);
break ;
case 4 :
printf ( "\nEnter child node to be deleted from Graph : %d"
) ;
scanf("%d",&q);
deledge( char adjmat[7][7], int numv ,int v1, int v2)
break ;
case 5 :
show( ) ;
getch( ) ;
break ;
default :
else
{
while ( temp != NULL )
{
if ( ( strcmp ( temp -> data, numv ) < 0 ) && ( ( strcmp ( temp
-> link -> data, numv ) > 0 ) ||
temp -> link ==
NULL ) )
{
q -> link = temp -> link ;
temp -> link = q ;
return ;
}
temp = temp -> link ;
}
}
}
}