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

C++ please struct Node { } 1. Define a function called remove. As an input param

ID: 667210 • Letter: C

Question

C++ please

struct Node {

}

1. Define a function called remove. As an input parameter, remove takes a Node pointer to an ordered list. It returns a Node pointer to the Node it is removing (hint: NOT deleting) from the ordered list. After remove has run, the ordered list pointed at by the input parameter no longer contains the Node that is being returned via a Node pointer.

2. Define a function called dequeue. As an input parameter, dequeue takes a Node pointer to a queue. It returns a Node pointer to the Node it is removing (hint: NOT deleting) from the queue. After dequeue has run, the queue pointed at by the input parameter no longer contains the Node that is being returned via a Node pointer.

Explanation / Answer

#include using namespace std; struct node { int data; node *next; }; class Linkedlist_Dequeue { private: int s; node *head,*tail; public : Linkedlist_Dequeue() { s=0; head=NULL; tail=NULL; } void insertAtEnd(int d) { node *p=new node; p->data=d; if(head==NULL) { head=p; //head->next=NULL; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote