- Assume Class Snode Friend Class Sll Int Data String C As Opposed To Int Data Snode Next Given The Followi 1 (97.85 KiB) Viewed 17 times
Assume: class SNode { friend class SLL; int data; string c; // as opposed to int data; SNode *next; }; Given the followi
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Assume: class SNode { friend class SLL; int data; string c; // as opposed to int data; SNode *next; }; Given the followi
Assume: class SNode { friend class SLL; int data; string c; // as opposed to int data; SNode *next; }; Given the following list: op->bi->tr->s->a->ho->pec If you run the following function, then print out the linked list, what do you get? void SLL::MakeIt() { } last->next = first; SNode *tmp = first; int ct = 0; int s2 = 0; SNode *tmp2; while (size > 0) { if (ct == 2) { if (s2 == 0) { } last = tmp2; Answer: } else { first = tmp->next; tmp->next = tmp->next->next; first->next = NULL; tmp2= first; tmp2->next = tmp->next; tmp->next = tmp->next->next; tmp2->next->next = NULL; tmp2 = tmp2->next; } s2++; ct = 0; size--; } ct++; tmp = tmp->next;