Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Strategic Database Technology Management For The Year 2000

Authors: Alan Simon

1st Edition

155860264X, 978-1558602649

More Books

Students also viewed these Databases questions

Question

Discuss the importance of workforce planning.

Answered: 1 week ago

Question

Differentiate between a mission statement and a vision statement.

Answered: 1 week ago