Answered step by step
Verified Expert Solution
Question
1 Approved Answer
part 2 #include #include #include struct node { int n; struct node *next; }; struct node *head = NULL; void print(){ struct node * current
part 2
#include#include #include struct node { int n; struct node *next; }; struct node *head = NULL; void print(){ struct node * current = head; while(current!=NULL){ printf("%d ", current->n); current=current->next; } printf(" "); } void insert(int number){ } void dequeue(){ } void pop(){ } void sort(){ } int main(int argc, char * argv[]){ int i; for(i=1;i Once you are done with Part 1, the next step is to make your list work as a queue or a stack. Youir job is to implement two functions: dequeue) and popO dequeue) will remove a node from the front of the list popO will remove a node from the back of the list. The output of your program then should look like this: gcc-Wall -o list.c list.c ./list 12 99 37 8 65 12 64 insert 12 insert99 insert 37 insert 8 insert 65 insert 12 insert 64 dequeue 12 Pop 64 pop 12 99 37 8 65
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started