Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The assignment: ( C++ / Data structures ) - Generate 30 Random numbers between 1 and 58 - Store the numbers in an array (

The assignment: ( C++ / Data structures )

- Generate 30 Random numbers between 1 and 58

- Store the numbers in an array

( Array entries are not sorted and can be duplicates. )

Read the numbers one at a time and store them in a link list while adhering to the following conditions:

  • As you copy the content of the randomly generated numbers from the array to the linked list, be sure to eliminate redundant numbers in the linked list and
  • Maintain the linked list numbers in ascending sorted order as you add more numbers
  • Track the redundant numbers separately by storing all duplicates in an array, and how each number is repeated.

Output: print the following to both console and textile:

  • The content of the originally generated array.
  • The content of the link list.
  • The content of the array/(another data structure) used for storing each number and its frequency.
  • Tacking the number of elements stored in the linked list.
  • All output must have proper text headings and formatting when printed to both a file and the screen.
  • You must have at least two files: one for storing the data structure and the related functions (e.g., header file). The second for storing the client code: the file with main method. Each function must perform only one task:
  • Overall code quality and performing proper functionalities.

Example:

Code one function to generate the random numbers and store them into an array

Another function to add to the linked list.

Another function to print the sorted array to file

And so on.

Random numbers: Array1: 15, 2, 8, 2, 2, : not in order and may have duplicates

Linked List 2, 8, 15 .

Array2 of duplicates: 2, 2 : not in order and consists of all instances except the first instance of the number.

Output to file and screen:

Array1

Linked list and how many elements in the linked list.

Array2

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

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions