Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 2 : ( 5 0 points ) Use your class Queue. java above to implement the Radix Sort algorithm using queues, as we discussed

Part 2: (50 points)
Use your class Queue. java above to implement the Radix Sort algorithm using queues, as we discussed in class and in the slides. Call the program/class RadixSort. java (saved in file RadixSort. java). The program prompts the user to enter the number of input values (that is the array size), then reads many positive integer values and store them in an array of type integer (call it inputs). The program then applies radix sort algorithm we discussed in class to the values stored in the original array inputs. Finally, print out the content of the array before and after being sorted as shown below. Integrate the following menu. No menu, no points!.
1- Read array size
2- Read array values
3- Run Radix Sort and print outputs
4- Exit program
Enter option number:
The program execution starts by displaying the menu. Make sure to re-display the menu after an option (other than option 4) is exercised. This makes the program user friendly, as the menu will always be insight. Again, make sure outputs are formatted as shown below. For example, if the user entered 6 integer numbers: 213,3465,7,29,541,45, the program output would be displayed as follows when option 3 is selected (this sample output shows option 3 output, no output for options 1 and 2):
Array values before sorting:
213,3465,7,29,541,45
Array values after sorting: 7,29,45,213,541,3465
Important note 1: Do not treat or manipulate the input values as string type at any point during the sorting process. The input values are read as integers and are manipulated as numeric integer values while being sorted. Digit extraction and other manipulations have to be done mathematically just like we discussed in the slides. Otherwise, the assignment gets 0 points. Before you update the original input array, make a copy of it into a string variable that you can use later for the required outputs.
Important note 2: Use ONLY one array (inputs), and ONLY one set of Queue objects (Q0 to Q9).
Radix sort requires mathematically extracting individual digits from a number. For that, implement a separate method, call it ExtractDigit (...), to do this function. See class notes. You also need to implement another method, call it countDigits (...), to count number of digits in a number. Document your code and organize the outputs properly.
image text in transcribed

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

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago