Assume: class DNode { friend class DLL; string s; // as opposed to int data; DNode *next; DNode *prev; }; Assume you hav

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 DNode { friend class DLL; string s; // as opposed to int data; DNode *next; DNode *prev; }; Assume you hav

Post by answerhappygod »

Assume Class Dnode Friend Class Dll String S As Opposed To Int Data Dnode Next Dnode Prev Assume You Hav 1
Assume Class Dnode Friend Class Dll String S As Opposed To Int Data Dnode Next Dnode Prev Assume You Hav 1 (100.23 KiB) Viewed 46 times
Assume: class DNode { friend class DLL; string s; // as opposed to int data; DNode *next; DNode *prev; }; Assume you have the following linked list: sh->li->ev->d->i-> If you run the following function, then print out the linked list, what do you get? void DLL::f3() { } DNode *tmp3= first->next; DNode *tmp2; while (tmp3 != NULL) { } Answer: DNode *tmp = tmp3; tmp2= tmp->prev; while (tmp2 != NULL && tmp2->s> tmp->s) { tmp2= tmp2->prev; } tmp3= tmp3->next; if (tmp->prev != tmp2) { } if (tmp->next == NULL) { last tmp->prev; } if (tmp->next != NULL) { } else { } if (tmp2 != NULL) { } else { tmp->prev->next = tmp->next; tmp->next->prev= tmp->prev; } tmp->prev->next = NULL; tmp->next = tmp2->next; tmp->prev= tmp2; tmp2->next = tmp; tmp->next->prev = tmp; tmp->next = first; first->prev = tmp; first = tmp; first->prev = NULL;
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply