I am having issues getting this Radix sort program to work properly. I know I am overlooking something but I am at a loss to what it is.
public class SortArrayAll{ public static void radixSort(String[] array, int n, int d){ ADTQueue<String>[] sort = new ADTQueue[n]; for (int k = 0; k < n; k++){ // create ADTQueue based on size of array sort[k] = new ADTQueue(); } for(int i=0; i<d;i++){ for(int j=0; j<n;j++){ char num = (array[j].charAt(i)); int sort1 = Integer.parseInt(Character.toString(num)); sort[sort1].enqueue(array[j]); } int Counter=0; for(int k=0; k<sort.length;k++){ while(!sort[k].isEmpty()){ array[Counter]=(String)sort[k].dequeue(); Counter++; } //you need to implement this sorting method } } } public static void main(String[] args){ String[] array = GenerateData.getData(20); int n = array.length; int d = array[0].length(); System.out.println("Origianl Data"); displayArray(array); radixSort(array, n, d); System.out.println("\nSorted Data"); displayArray(array); } static <T> void displayArray(T[] array){ for(int i=0;i<array.length; i++){ System.out.print(array[i]+" "); } System.out.print("\n"); } }