Program to maintain a doubly linked list
#include #include #include /* structure representing a node of the doubly linked list */ struct dnode { struct dnode *prev ; int data ; struct dnode * next ; } ; void d_append ( struct dnode **, int ) ; void d_addatbeg ( struct dnode **, int ) ; void d_addafter ( struct dnode *, int , int ) ; void d_display ( struct dnode * ) ; int d_count ( struct dnode * ) ; void d_delete ( struct dnode **, int ) ; void main( ) { struct dnode *p ; p = NULL ; /* empty doubly linked list */ d_append ( &p , 11 ) ; d_append ( &p , 2 ) ; d_append ( &p , 14 ) ; d_append ( &p , 17 ) ; d_append ( &p , 99 ) ; clrscr( ) ; d_display ( p ) ; printf ( "\nNo. of elements in the DLL = %d\n", d_count ( p ) ) ; d_addatbeg ( &p, 33 ) ; d_addatbeg ( &p, 55 ) ; d_display ( p ) ; printf ( "\nNo. of elements in the DLL = %d\n", d_count ( p ) ) ; d_addafter ( p, 4, 66 ) ; d_addafter ( p, 2, 96 ) ; d_display ( p ) ; printf ( "\nNo. of elements in th...