Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2: Considering the following implementation for List class members fun1() and fun2() [4 marks] void List::fun1(List& 1){ Node c= 1.head; while(c != nullptr){ } }
2: Considering the following implementation for List class members fun1() and fun2() [4 marks] void List::fun1(List& 1){ Node c= 1.head; while(c != nullptr){ } } this->add_to_head(c->val); What the following main function with print? int main() { c=c->next; List list1, list2, list3; for (int i = 0; i < 5; i++) { list1.add_to_head (i); list1.add_to_tail(i); } } for (int j = 6; j<10; j++) { list2.add_to_tail(j); } list1.print(); cout << endl; for (int i = 0; i < 3; i++) { list1.remove_head(); list1.remove_tail(); list1.print(); cout << endl; list1.fun1(list2); list1.print(); void List::fun2(List& 1){ Node cl.head; while(c != nullptr){ if(c->next!=nullptr) } this->add_to_tail(c->val); c=c->next
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started