Question
***Using C++ and also please label a and c accordingly. Thank you!!**** a) Write the member function void deleteNode() that will delete the first node
***Using C++ and also please label "a" and "c" accordingly. Thank you!!****
a) Write the member function void deleteNode() that will delete the first node from the linked list.
b) Modify the LList to create a data member Node *cur that points to the current node. Write the following member functions:
void forward() that moves the cur pointer to the next node.
void backward() that moves the cur pointer to the previous node.
void delete() that removes the node that is pointed to by the cur pointer. ( Think of how you will set the cur pointer after the delete and state your strategy.)
double getValue() that returns the value of the node that is pointed to by the cur pointer.
c) Write the member function Node *findFirstNodeByValue(double x) that will return the reference of the first node that has the value x. You start your search from the pointer cur.
class Node public: double v Node next;/ Points to the nert Node Node *prev/ Points to the previous Node class LList Node head public: void addNode (double v); // Add a node to the end of the link list //Member Functions here tiStep 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