Answered step by step
Verified Expert Solution
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 : 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 programclass 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!.
Read array size
Read array values
Run Radix Sort and print outputs
Exit program
Enter option number:
The program execution starts by displaying the menu. Make sure to redisplay the menu after an option other than option 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 integer numbers: the program output would be displayed as follows when option is selected this sample output shows option output, no output for options and :
Array values before sorting:
Array values after sorting:
Important note : 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 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 : Use ONLY one array inputs and ONLY one set of Queue objects Q to Q
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started