(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
Step: 1
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