Question: Implement the PrintList() function appropriately to print out the names stored in the list. You do NOT need to add the void SortedList::PrintList() const or

Implement the PrintList() function appropriately to print out the names stored in the list. You do NOT need to add the void SortedList::PrintList() const or the brackets, just the code that is within the function.

OUTPUT EACH NAME ON A SEPARATE LINE WITH std::endl SEPARATING EACH OUTPUT.

Implement the PrintList() function appropriately to print out the names stored in

3 8 1 #include 2 #include 3 4 v struct Node 5 { 6 std::string name; 7 Node * nextNode; }; 9 10 11 v class SortedList 12 { 13 private: 14 Node *_beginningNode; 15 Node *_endingNode; 16 17 public: 18 SortedList(); 19 SortedList(); 20 21 void AddItem(const std::string & name); 22 void RemoveItem(const std::string & name); 23 void PrintList() const; 25 }; #include "sortedlist.hpp" 124 1 2 5 6 Sortedlist::SortedList() { 1/ implement the destructor to delete all // items from this list when the list leaves scope 1/ syntax MUST be correct to get full credit. } 8 9 10 11 12 13 14 15 16 17 18 19 20 void Sortedlist::PrintList() const { // implement the print List function to output the // names of every item in this list. 1/ syntax MUST be correct to get full credit. }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!