- Assume Class Snode Friend Class Sll String S As Opposed To Int Data Snode Next Given The Following Linked 1 (98.93 KiB) Viewed 30 times
Assume: class SNode { }; friend class SLL; string s; // as opposed to int data; SNode *next; Given the following linked
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Assume: class SNode { }; friend class SLL; string s; // as opposed to int data; SNode *next; Given the following linked
Assume: class SNode { }; friend class SLL; string s; // as opposed to int data; SNode *next; Given the following linked list: pumpkin->morbid->scream->tomb->skull What is printed in printit()? SNode *SLL:: f1(SNode *tmp, SNode *tmp2) { if (tmp == NULL) { return tmp2; } } else { } // (expression 1)? expression 2 : expression 3 // if expression 1, then expression 2 else expression 3 } void SLL::printit() { (tmp->s> tmp2->s) ? f1(tmp->next, tmp): f1(tmp->next, tmp2); Answer: SNode *x = f1(first->next, first); cout << x->s << endl;