Question: In this project, you will use radix.txt as the input file, and output the integers SORTED USING RADIX SORT. Your main program will input the
In this project, you will use radix.txt as the input file, and output the integers SORTED USING RADIX SORT.
Your main program will input the integers and put them into a QUEUE. It will then pass this queue to a method called radixSort which will sort the numbers in the queue, passing the sorted queue back to main.
The main program will then call another method to print the contents of this (sorted queue) .
Notes:
1. radixSort method will need an array of queues.
2. radixSort will NOT print the queue.
3. Use the java Queue class.
What I have so far:
import java.util.LinkedList; import java.util.Queue; import java.util.*; import java.io.*;
public class H8 { public static void main(String[] args) { File inFile=new File("radix.txt"); Scanner scnr=null; //Try/Catch try{ scnr=new Scanner(inFile); } catch(FileNotFoundException e){ } String temp = null; String[] fileStrings = new String[25]; createArray(fileStrings); Queue
public static int getLength(String[]nums){ int i; int max = 0; int count = 0; int size = nums.length; String s = null; for (i=0; i
I cant get the getLength method to work which I want to return the max digits in the string that I am getting from the file...please help
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
