Question: #include #include using namespace std; class Node{ public: int value; Node* Next; Node* temp; Node* head = NULL; void push(int value){ Node* newNode = new

 #include #include using namespace std; class Node{ public: int value; Node*

#include #include using namespace std; class Node{ public: int value; Node* Next; Node* temp; Node* head = NULL; void push(int value){ Node* newNode = new Node(); newNode->value = value; newNode->Next = NULL; if(head == NULL){ head = newNode; temp = head; } else{ temp->Next = newNode; temp = newNode; } } void delete_(int key){ Node* del = new Node(); temp = head; if(head->value == key){ head = head->Next; } else{ while(temp->Next->value != key){ temp = temp->Next; } del = temp->Next; temp->Next = temp->Next->Next; } delete del; } void traverse(){ Node* temp = head; while(temp != NULL){ cout valueNext; } } };

int main (){ int size , op, key, value; Node List = Node(); while(op != 5) { cout>op; if(op == 1) { cout>size; for(int i = 0 ; i > value; List.push(value); } List.traverse(); //List->push(value); } else if(op == 2){ cout>key; List.delete_(key); List.traverse(); } else if(op == 3){ cout> key; cout>value; List.insertAtSpecificPosition(value, key); List.traverse(); } else if(op == 4){ cout >key; cout>value; List.update(key, value); List.traverse(); } else{ cout Lab Task 5 Your task is to complete this cpp file as uploaded. We have done two operations on LinkedList which were to delete a Node and to append a node during run time. Now, your job is to insert a Node and to update a current Node. The template is given below you just have to write a code and make a word file too for this lab task where you have to discuss your logic and views

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!