Question: Implement the setValue function of the LinkedList class . bool LinkedList::setValue(int position, int d) The job of this function is to change the data at
Implement the setValue function of the LinkedList class .
bool LinkedList::setValue(int position, int d)
The job of this function is to change the data at the given position to d. You don't need to create or delete any nodes here; just change the data of an existing node. Hint: call getNodeAtPosition and assign the result to a variable temp. Then if temp is null, just return false and leave the list unchanged. Otherwise change temp->data to d and return true .
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
