Question: Data Structure and Algorithm. Java or C++, please. Thank you You are asked to write a program that prompts the user for the size of

Data Structure and Algorithm.

Java or C++, please. Thank you

You are asked to write a program that prompts the user for the size of two integer arrays, user input for the size must not exceed 50, you must validate this. We will use these arrays to represent our sets. These arrays will be randomly populated in the range that is 1 through double the size of the array. So if the array is of size 20, you will randomly populate it with values in the range 1-40 inclusive.

Following the above-mentioned rules for sets, you must avoid having duplicates while randomly populating them. This means that if a random number already exists in the set, you should skip that and generate another random number to store in the array.

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!