Assignment 8 Question 1
#include <stdio.h> #include <stdlib.h> struct DoublyLinkedList{ int data; struct DoublyLinkedList *prev; struct DoublyLinkedList *next; }; void removeNode ( struct DoublyLinkedList **headptr, struct DoublyLinkedList **tailptr, struct DoublyLinkedList *ptr) { if ( ptr == *headptr ){ *headptr = ptr->next; (*headptr)->prev = NULL; }else{ if ( ptr == *tailptr ) { *tailptr = ptr->prev; (*tailptr)->next=NULL; }else{ ptr->prev->next = ptr->next; ptr->next->prev = ptr->prev; } } free ( ptr ); ptr = NULL; return; } void removeData ( struct DoublyLinkedList **headptr, struct DoublyLinkedList **tailptr, int n) { struct DoublyLinkedList *curr; curr = *headptr; while ( curr != NULL && curr->data != n ){ curr = curr->next; } if ( curr != NULL ){ removeNode(headptr, tailptr, curr); } return; } struct DoublyLinkedList *createNode(int n) {...