Question: 1 . Write a c + + program to do the following: a . Generate 1 0 random numbers between 1 0 and 4 0
Write a cprogram to do the following:
a Generate random numbers between and and store them in linked list pointed by ALL.
b Create an algorithm for making changes to the list ALL such that all even numbers appear at the beginning of the list. Use one of the following hints to write your program
HINT While traversing ALL, collect even numbers in list EVEN and odd numbers in list ODD. Now to get the final list, simply append the two lists EVEN and ODD
HINT While traversing ALL, create a NEW list by inserting even numbers in front and odd numbers at the rear of the list
Sample run:
Original list ALL: NULL
New list ALL : NULL
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
