Below is a depiction of a doubly-linked list implementation of the bag ADT with two sentinels -one at the head and one at the tail. Strict DLink { TYPE value; strict DLink * next; struct DLink * prev;}; strict linked List { int size; struct DLink *frontSentinel; struct DLink *backSentinel;}; Write a function that at first reverses the list and then prints the values of the links in the list from front to back. Don\'t redirect to any other function. You must use assertions if necessary. Solution /* Program to reverse a doubly linked list */ #include <stdio.h> #include <stdlib.h> /* a node of the doubly linked list */ struct node { int data; struct node *n; struct node *pr; }; /* Function to reverse a Doubly Linked List */ void reverse(struct node **head_r) { struct node *t = NULL; struct node *cur = *head_r; /* swap next and prev for all nodes of doubly linked list */ while (cur != NULL) { t = cur->pr; cur->pr = cur->n; cur->n = t; cur = cur->pr; } /* Before changing head, check for the cases like empty list and list with only one node */ if(t != NULL ) *head_r = t->pr; } /* UTILITY FUNCTIONS */ /* Function to insert a node at the beginging of the Doubly Linked List */ void push(struct node** head_r, int new_data) { /* allocate node */ struct node* n_node = (struct node*) malloc(sizeof(struct node)); /* put in the data */ n_node->data = n_data; /* since we are adding at the begining, prev is always NULL */ n_node->pr = NULL; /* link the old list off the new node */ n_node->n = (*head_r); /* change prev of head node to new node */ if((*head_r) != NULL) (*head_r)->pr = n_node ; /* move the head to point to the new node */ (*head_r) = n_node; } /* Function to print nodes in a given doubly linked list This function is same as printList() of singly linked lsit */ void printList(struct node *node) { while(node!=NULL) { printf(\"%d \", node->data); node = node->next; } } /* Drier program to test above functions*/ int main() { /* Start with the empty list */ struct node* head = NULL; /* Let us create a sorted linked list to test the functions Created linked list will be 10->8->4->2 */ push(&head, 2); push(&head, 4); push(&head, 8); push(&head, 10); printf(\"\ Original Linked list \"); printList(head); /* Reverse doubly linked list */ reverse(&head); printf(\"\ Reversed Linked list \"); printList(head); getchar(); } .