Question: (In C++) Code a singly linked list where each node includes 3 different data types: A country (string), its capital (string), and its total population
(In C++) Code a singly linked list where each node includes 3 different data types: A country (string), its capital (string), and its total population (int). Additionally, create two methods to 1) add a new country at the front of the list and 2) remove a country at the front of the list. Create the class and use it to add new countries, their capitals, and populations to the list. The addition of data ends when the user inputs an empty string. Once it ends, break the list down into two parts with one being for the countries at the even positions and the other being at the odd positions. Print the lists.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
