$24
he assignment:
Generate 30 Random numbers between 1 and 58
Store the numbers in an array
Array entries are not sorted and can have 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 to the linked list.
• Track the redundant numbers separately by storing all duplicates in an array to calculate how many times each number was repeated.
Output: print the following to both console and textile:
• The content of the originally generated array.
• The content of the LinkedList.
• The content of the array storing the duplicates and how often each number is being duplicated.
• A method to find and display the length of the LinkedList. 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.
• Make sure that all your functions are specialized and kept in a separate file (e.g., .h file) from the file with the 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