Question: Problem 9 (1 pt): Given the following linked list: _____________________________ 3->32->18->30->9->12 If you run the following function, then print out the linked list, what do

Problem 9 (1 pt): Given the following linked list: _____________________________

3->32->18->30->9->12

If you run the following function, then print out the linked list, what do you get?

void SLL::f3() {

SNode *tmp;

SNode *tmp2 = first;

while (tmp2->next != NULL) {

tmp = tmp2->next;

tmp2->next = tmp2->next->next;

tmp->next = first;

first = tmp;

}

last = tmp2;

}

I know this would reverse the whole entire list , but could you draw line by line what is going on. In other words how every itteration is going on.

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!