Radix sort is a sorting algorithm which sorts key/value pairs with integer keys by ordering digits.
Questions tagged [radix-sort]
307 questions
3
votes
4 answers
Radix Sort Algorithm
I have been given some algorithms to reverse engineer. The algorithm below is a radix sort, but I am very confused about what is actually happening in the code.
I'm new to algorithms and am unsure how the code sorts elements in an array. I'm not…
![](../../users/profiles/3185731.webp)
user3185731
- 139
- 1
- 10
3
votes
1 answer
Questions on an implementation of Radix sort in Java
The following Radix sort does four passes of counting sort (256 buckets, 32-bit integers, starting from lowest significant digits), taken from Sedgewick's Algorithms textbook.
public class LSD {
private final static int BITS_PER_BYTE = 8;
…
![](../../users/profiles/2282592.webp)
alwc
- 162
- 4
- 14
3
votes
2 answers
Best Base for Radix Sort
I have read several sources about this topic. However, I am having trouble figuring out exactly what these formulas mean. It seems that Radix Sort is Linear when b = n. Does this mean, I should set the base to the length of the array?
If I have…
![](../../users/profiles/2587878.webp)
user2587878
- 101
- 2
- 14
3
votes
2 answers
Does radix sort work with numbers who have different number of digits?
I know that radix sort works by comparing the digits of the numbers. My question is, assume we have different numbers with different number of digits. Does radix sort work here? We can simply assume that, for example, if we are comparing two…
user2110714
2
votes
1 answer
Radix sort implementation for datasets in SAS
In my day-to-day work I'm often working with datasets that contain millions of rows, sometimes 100s of millions, and occasionally over 1 billion. These datasets often need to be sorted. The keys are almost always large integer values (usually 9…
![](../../users/profiles/214994.webp)
Robert Penridge
- 8,257
- 2
- 31
- 50
2
votes
2 answers
Radix sort not working in Lua
Firstly I should mention I've not been coding very long at all, although that much is probably obvious from my code :P
I'm having two problems, firstly the sort isn't functioning correctly but does sort the numbers by their length. Any help here…
![](../../users/profiles/993810.webp)
mike
- 21
- 1
2
votes
1 answer
Radix sort algorithm with O(n) worst case
Let's say that you are given an integer array A of size n. You know in advance that O(√n) elements of A can be larger than 2020(n)^(5) − 5n, and the remaining elements of A are in the range [1, 2020n^5 − 5n]. It turns out that, in this case, A can…
![](../../users/profiles/15236657.webp)
fabio contreras
- 71
- 6
2
votes
1 answer
Radix Sort in File C#
This is an assignment from university. I have to do a Radix sort on car registration plates (ABC 123) in two ways 1) array 2) linked list. The most interesting thing is that sorting MUST BE done in the file. For example, from now on we will talk…
![](../../users/profiles/12940703.webp)
Povilas Dirse
- 95
- 7
2
votes
1 answer
Radix Sort for Strings in Python
My radix sort function outputs sorted but wrong list when compared to Python's sort:
My radix sort: ['aa', 'a', 'ab', 'abs', 'asd', 'avc', 'axy', 'abid']
Python's sort: ['a', 'aa', 'ab', 'abid', 'abs', 'asd', 'avc', 'axy']
* My radix sort does not…
![](../../users/profiles/11798621.webp)
PenguinSnow
- 59
- 5
2
votes
2 answers
changing radix-sort base?
I'm trying to understand radix-sort but having problems understanding changing bases in implementing the actual code. This is the code i'm using to learn radix-sort and i'll try to explain what i don't understand.
This Code is by GeeksForGeeks:
//…
![](../../users/profiles/6675878.webp)
STOPIMACODER
- 669
- 4
- 14
2
votes
2 answers
Very basic radix sort
I just wrote a simple iterative radix sort and I'm wondering if I have the right idea.
Recursive implementations seem to be much more common.
I am sorting 4-byte integers (unsigned to keep it simple).
I am using 1-byte as the 'digit'. So I have…
![](../../users/profiles/21906.webp)
Fredrick
- 1,000
- 2
- 13
- 22
2
votes
1 answer
How does radixsort work on strings in R?
I tried to generate some ASCII-string vectors and sorted them using sort and sort(..., method="radix"); however the sorted vectors are DIFFERENT! I tried to read through the radixsort help and these were nothing to suggest that radixsort should sort…
![](../../users/profiles/239923.webp)
xiaodai
- 11,863
- 14
- 63
- 97
2
votes
1 answer
Making radix sort in-place - trying to understand how
I'm going through all the known / typical sorting algorithms (insertion, bubble, selection, quick, merge sort..) and now I just read about radix sort.
I think I have understood its concept but I still wonder how it could be done in-place? Let me…
![](../../users/profiles/6275216.webp)
eyesima
- 279
- 4
- 13
2
votes
2 answers
Radix Sort Optimization
I was trying to optimize the Radix Sort code, because I felt there was room for it as traditional codes in books and on web seem a direct copy of one another and also they work very slow as they take an arbitrary number such as 10 for modulo…
![](../../users/profiles/6273378.webp)
ytoamn
- 177
- 1
- 11
2
votes
1 answer
Could someone share the benchmarks of Radix sort on GTX 580?
Could someone share the benchmarks of Radix sort on GTX 580?
![](../../users/profiles/117802.webp)
Roman Kagan
- 10,082
- 24
- 79
- 123