import java.util.*;
public class MainProgram
{
public static void main(String[] args)
{
Scanner userinput = new Scanner(System.in);
System.out.print("Please enter the size of the array. ");
int count = userinput.nextInt(); //user enters the size of the array.
int[] numbers = new int[count]; //array containing hte integers.
int r=0;
QueueLinkedList[] queue = new QueueLinkedList[10]; //created an instance of the queue. 10 bins needed for the Radix Sort.
for(int i=0; i<queue.length; i++)
{
queue[i] = new QueueLinkedList();
}
for(int index = 0; index < numbers.length; index++) //generating random integers.
{
numbers[index] = (int)(Math.random()*1001);
System.out.print(index+" ");
System.out.println(numbers[index]);
}
for(int i=0; i<numbers.length; i++) //identifying the LSD and store the integers in queues accoring to the LSD.
{ //the mistake is in this loop!
numbers[r] = (numbers[i] % 10)/1;
// System.out.println(numbers[r]);
queue[r].enqueue(numbers[i]);
//queue[r].dequeue();
}
for(int i=0;i<queue.length;i++){ //deque and printing the integers. Here the integers should be sorted by the LSD. 1st PASS.
queue[r].dequeue(); //however output is noot good!
}
}
}