A radix is the number of distinct symbols used to represent numbers in a particular base.
Chat with our AI personalities
Base 2 can also be called Radix 2. Therefore the word 'Radix' can be used for 'Base'.....
radix sort
254
You'll have to make some modifications to the "standard" radix sort. You can add on a set value to make all the numbers positive, then sort with radix sort, then subtract the value off all of them at the end. This probably isn't the best all-round solution because if your numbers get very large (and large negative numbers), you may be unable to add on the set value to make all your values positive without having the problem of overflow. In this case you'd have to make a division - a section of negative numbers, and a section of of positive numbers. Sort both of them using radix sort, then reverse the negative numbers section and put the lists together (remembering to sort out the minus signs before sorting the negative numbers).
-19