Assume: class SNode { friend class SLL; int data; string c; // as opposed to int data; SNode *next; }; Given the followi

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
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

Post by answerhappygod »

Assume Class Snode Friend Class Sll Int Data String C As Opposed To Int Data Snode Next Given The Followi 1
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 16 times
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;
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply