answersLogoWhite

0


Best Answer

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).

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you use negative numbers in radix sort?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you use negative and positive numbers in everyday?

negative numbers> temperature.


How many algorithms are there for sorting purpose and what are they?

There are many sorting algorithms however there are only a small handful that we actually use: insertion sort (stable) is typically used for small sets while large data sets primarily use heapsort (unstable), merge sort (stable) or quicksort (unstable). Efficient implementations typically use a hybrid sort such as Timsort (stable) or introsort (unstable). The following lists all the documented algorithms currently listed in Wikipedia's "Sorting algorithm" page: Quicksort, merge sort, in-place merge sort, heapsort, insertion sort, introsort, selection sort, Timsort, cubesort, shell sort, bubble sort, binary tree sort, cycle sort, library sort, patience sorting, smoothsort, strand sort, tournament sort, cocktail sort, comb sort, gnome sort, unshuffle sort, Franceschini's sort, block sort, odd-even sort, pigeonhole sort, bucket sort (uniform keys), bucket sort (integer keys), counting sort, LSD radix sort, MSD radix sort, MSD radix sort in-place, spreadsort, burstsort, flashsort, postman sort bead sort, simple pancake sort, spaghetti sort, sorting network, bitonic sorter, bogo sort, stooge sort, Han's algorithm, Thorup's algorithm.


What are some ways you use negative numbers in everyday life?

Some people work as a teacher or a mathmetition, they use negative numbers in their everyday lives. Some people use negative numbers when they are overdue.


Why you use negative numbers?

we use negative numbers because if negative numbers wont be dere den den positive numbers wont also be dere so dere wont be any number.


Why do you use negative numbers in Math?

You use negative numbers to represent subtractions (10-5 is same as 10 + -5) Also, you use these to represent things that can be negative.


When do you use a negative numbers?

You use a negative rational number when an answer is below zero.


What are 10 real life situations do we use negative numbers?

Negative numbers are often used when there are opposites; in this case, one of the opposites is assigned positive numbers, the other, negative numbers. For example, you might:* Use positive numbers for positions above sea level, and negative for below sea level. * Use positive numbers for money you have in your bank account; negative numbers for money you owe others. * Use positive numbers for northern latitudes, and negative numbers for southern latitudes. Or vice versa. * There are lots of other situations where opposites are involved, but you probably get the idea.


What happened 16th century that caused people to use negative numbers?

they wanted numbers below zero and called them negative numbers


How do you use negative rational numbers?

Negative rational numbers are used in the same way that negative whole numbers are used: they are simply the additive inverses of their positive counterparts.


Why do you use negative numbers?

cause we can that's why


What was the number that is essential in order to use negative numbers?

the number is 10000 because that is what negative numbers go up to


What are things you use negative numbers for?

There are lots of things people use negative numbers for. You use negative numbers when you see temperature and sea levels. In stock markets and in banks negative numbers are used. Go look in the freezer, negative numbers there. Play golf? Football? Football field there is negative numbers. Also when you borrow money, you have $0, then you want to buy ice cream, which is $1. So you borrow your friend's money. Now you don't have $0, you have $-0. I wish my explanation helped^^!