Question: How do I implement a Java Radix sort for vectors? Question is below. Input structure You are going to apply Radix-Sort to sort vectors. The
How do I implement a Java Radix sort for vectors? Question is below.
Input structure You are going to apply Radix-Sort to sort vectors. The input starts with an integer number which indicates the number of vectors to be sorted. Then vectors follow, one vector per line. Each vector consists of 10 digits where each digit has a value in 0..9. Entries of a vector are separated by a space. Output structure Output the sorted sequence of vectors, one per line. Vector i must appear before vector j in your output if and only if for some d E 1,2, 10), vector i is smaller than or equal to vector j on the dth entry, and the two vectors are equal for any of the first d-1 entries. Examples of input and output Input 5 33 3 3 3 22222 2 3 222 2222 2 1300 210000 130022000 2 3 21 2222 2 2 Output 1;3:0;0;2;1:0:0:0;0 1:3:0:0;2:2:0:0:0;0; 2;3;2:1;2:2:2:2:2:2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
