Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

13. You always should try to make a good first impression.

Answered: 1 week ago