6. What is the output of the following C++ code? (The class unorderedLinkedList
ID: 3658920 • Letter: 6
Question
6. What is the output of the following C++ code? (The class unorderedLinkedList is as defined in this chapter.) unorderedLinkedList list; unorderedLinkedList copyList; int num; cin>>num; while (num != -999) { if (num % 4 == 0 | | num% 3 == 0) list.insertFirst (num); else list.insertLast (num); cin>>nume; } cout<<"copyList = "; list.print(); cout<<endl; copyList = list; copyList.deleteNode(33); copyList.deleteNode(58); cout<<"copyList = "; copyList.print(); cout<<endl;Explanation / Answer
suppose the input is 45 33 12 83 40 58 11 98 64 120 16 -999 so after this the list will contain the data in this order: 16 120 64 40 12 33 45 83 58 11 98 OUTPUT:- copyList = 16 120 64 40 12 33 45 83 58 11 98 copyList = 16 120 64 40 12 45 83 11 98
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.