I was wondering if anyone knew how to do a radix sort in Java. I need to write a program that asks a person to enter a number
. Then I need to fill an array with n random numbers. After I fill the array I need to start the radix sort using two multidimensional arrays (Binone and Bintwo). After this is completed I need to fill the original array with the searched array. Here is my code I have so far if anyone can help it would be greatly appreciated.
import javax.swing.*;
import java.util.Random;
public class Binsort{
public static void main (String args[]){
String input= JOptionPane.showInputDialog
("How many Numbers do you wish to sort?"
;
int numbers= Integer.parseInt(input);
int[]numarray = new int[numbers];
for (int i=0; i<numbers; i++){
Random rn = new Random();
int random_num= rn.nextInt(i + 1);
numarray= random_num;
System.out.println (numarray);
}
int [][]binone= new int[10][numarray.length];
int [][]bintwo=new int [10][numarray.length];
for(int counter=0;counter<numarray.length;counter++){ int place = numarray[counter%1];
binone[place][counter]=numarray[counter];
System.out.println ("Binone " + place +" " + counter+ " has value of "+ binone [place][counter]);
}
System.exit(0);
}
}

import javax.swing.*;
import java.util.Random;
public class Binsort{
public static void main (String args[]){
String input= JOptionPane.showInputDialog
("How many Numbers do you wish to sort?"

int numbers= Integer.parseInt(input);
int[]numarray = new int[numbers];
for (int i=0; i<numbers; i++){
Random rn = new Random();
int random_num= rn.nextInt(i + 1);
numarray= random_num;
System.out.println (numarray);
}
int [][]binone= new int[10][numarray.length];
int [][]bintwo=new int [10][numarray.length];
for(int counter=0;counter<numarray.length;counter++){ int place = numarray[counter%1];
binone[place][counter]=numarray[counter];
System.out.println ("Binone " + place +" " + counter+ " has value of "+ binone [place][counter]);
}
System.exit(0);
}
}