Question: C++ Program, assume a helper function and main have been implemented already Problem 2 Task: Write a program that creates a linked list of integers

C++ Program, assume a helper function and main have been implemented already

C++ Program, assume a helper function and main have been implemented already

Problem 2 Task: Write a program that creates a linked list of integers and then splits it into two lists, one containing the even integers and one containing the odd integers. You may implement all of this in a main function. Requirements: 1. Implement an print function: (you may change the function header below to suit your implementation) void print(Node *head); // example declaration The print function should print the elements of a linked list in order from beginning to end. 2. Write a main function that creates a linked list of integers, then splits it into two lists as described above. Then print the resulting lists to demonstrate that you performed the splitting successfully. Repeat this for several different starting linked lists to show that it works for all cases. 3. Test your function to make sure that it works in every case, no matter how many even/odd numbers are in the original linked list. Problem 2 Task: Write a program that creates a linked list of integers and then splits it into two lists, one containing the even integers and one containing the odd integers. You may implement all of this in a main function. Requirements: 1. Implement an print function: (you may change the function header below to suit your implementation) void print(Node *head); // example declaration The print function should print the elements of a linked list in order from beginning to end. 2. Write a main function that creates a linked list of integers, then splits it into two lists as described above. Then print the resulting lists to demonstrate that you performed the splitting successfully. Repeat this for several different starting linked lists to show that it works for all cases. 3. Test your function to make sure that it works in every case, no matter how many even/odd numbers are in the original linked list

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!