radix-sort

Java Bit Operations (In Radix Sort)

The other day I decided to write an implementation of radix sort in Java. Radix sort is supposed to be O(k*N) but mine ended up being O(k^2*N) because of the process of breaking down each digit to one number. I broke down each digit by modding (%) the preceding digits out and dividing by ten to eliminate the succeeding digits. I asked my...

In-Place Radix Sort

This is a long text. Please bear with me. Boiled down, the question is: does someone know a workable in-place radix sort algorithm? Preliminary I've got a huge number of small fixed-length strings that only use the letters “A”, “C”, “G” and “T” (yes, you've guessed it: DNA) that I want to sort. At the moment, I use std::sort which u...

Is there a good library for sorting a large array of numbers in C?

If I have a large array of integers or floats, what is a good algorithm/ implementation for sorting (in C)? It is a bit late in the game for an edit... but I am looking for correctness and speed. ...

Radix Sort implemented in C++

UPDATE: I managed to re-work my code from scratch, and here is what I came up with. It works, but the only problem is speed. Is there any way that I can speed up my current set up using better memory management? If so, what would be the best approach? #include <iostream> #include <vector> #include <math.h> using namespace std; void pri...

Any ready-made implementation of Radix Sort for C#?

Preferrably with any non-virus open source license ...

Radix Sort Java

Welcome. I have a radix sorting method that uses an array to go through, but has to have another array (bin) that will store in an empty queue. I am confused as to how I would make a queue for the bins. I also have a findPlace method that finds the place of the each digit when called upon. So, here is what I got. Can someone help me find...

When is the appropriate time to use Radix Sort?

What are the constraints on your data for you to be able to use Radix sort? If I'm sorting a large list of integers, would it be appropriate to use Radix sort? Why is Radix sort not used more? ...

Is there a good radixsort-implementation for floats in C#

I have a datastructure with a field of the float-type. A collection of these structures needs to be sorted by the value of the float. Is there a radix-sort implementation for this. If there isn't, is there a fast way to access the exponent, the sign and the mantissa. Because if you sort the floats first on mantissa, exponent, and on exp...

Best way to get individual digits from int for radix sort in C/C++

What is the best way to get individual digits from an int with n number of digits for use in a radix sort algorithm? I'm wondering if there is a particularly good way to do it in C/C++, if not what is the general best solution? edit: just to clarify, i was looking for a solution other than converting it to a string and treating it like ...

LSD Radix Sort code in java, question

A am studding for an Exam that I will have about sorting algorithms. And a Friend of mine gave me this code about LSD Radix Sort. And I don't why he is using the numbers 96,97 and 64? I've read a few things about LSD radix sort, but I didn't understand too much how it works. public class LSDRadix { private static String[] list; public...

Sort N numbers in digit order

I found out about this question recently. Given a N number range Eg. [1 to 100], sort the numbers in digit order (i.e) For the numbers 1 to 100, the sorted output wound be 1 10 100 11 12 13 . . . 19 2 20 21..... 99 This is just like Radix Sort but just that the digits are sorted in reversed order to what would be done in a normal Radix...

Which is faster: a "radix tree" or a "b-tree"

For processing language, as in regular dictionary words, which would be faster at reading, a radix tree, or a regular b-tree? Is there a faster method, such as a dictionary with buckets & hashing? ...

Why quicksort is more popular than radix-sort?

Why quicksort(or introsort), or any comparison-based sorting algorithm is more common than radix-sort? Especially for sorting numbers. Radix-sort is not comparison based, hence may be faster than O(n*logn). In fact, it is O(k*n), where k is the number of bits used to represent each item. And the memory overhead is not critical, since yo...

Radix Sort in JavaScript

I've come up with the following but it predictably doesn't work. var t = new Array(a.length); var r = 4; var b = 64; var count = new Array(1<<r); var pref = new Array(1<<r); var groups = Math.ceil(b / r); var mask = (1 << r) - 1; var shift = 0; for(var c = 0; c < groups; c++) { shift += r; for(var j = 0; j < count.length; j...