Specification
RadixSort.java contains a couple of defects that need to be fixed. These defects are listed in the
"caveats" section of the program's file comment block.
Note: class RadixSort extends Object and this cannot be changed.
Part 0
Modify the program so that the elements of array a are in following domain:
Integer.MIN_VALUE ≤ a[i] ≤ Integer.MAX_VALUE
where 0 ≤ i < a.length
Part 1
Modify the program so that the "buckets" are not array length sized array-of-ints (i.e. space hogs).
Each bucket, when used, becomes a singly-linked-list of class IntNode objects.
class IntNode {
int n;
IntNode next;
}
Note: The "buckets" 2-dimensional array switches from type int to type IntNode and null is used as
EMPTY_SLOT.
Get Free Quote!
414 Experts Online