Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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