Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In C programming, using aspects of the old code provided and writing in first-ye

ID: 3763096 • Letter: I

Question

In C programming, using aspects of the old code provided and writing in first-year programming code:


We're going to simulate the line at Starbucks using a linked list. In computer science (and British English), the Starbucks line is an example of a queue: a list where things are added at one end and removed at the other.

We're going to use the linked list structure and functions we wrote in class this week and add an additional function: delete from the back.

In main, test your new function by making a list, adding people to the front, and deleting the end of it, printing the list after each operation.


Here is a sample output (you can hardcode a sequence of people arriving/leaving inside main)

#include #include #include struct Node int data; struct Node* next; typedef struct Node Node; typedef struct Listf List: List makeEmptyList() Node* head; List ret; ret.headNULL return ret; void prependToList (List* l, int data)( Node * n n->data n->next malloc (sizeof (Node)); data; 1->head ; = |->head = n; void printList (List l){ for (Node * cursor 1.head; cursor !.. NULL ;

Explanation / Answer

we will implement a queue as a linked list where elements can be added in the front and removed from the the end. we can add,remove, show and see if the queue is empty or not.

Output: