RadixSort.java contains a couple of defects that need to be fixed

computer science

Description

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.


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.