<p>Radix sort is a sorting algorithm that runs in linear time because it doesn't use algebraic comparisons. Its main limitation is that, because of this, it can only sort integers. However, a 32-bit floating-point number and a 32-bit integer can hold the same number of values, so there exists a theoretical conversion between the two that preserves comparison operators (worst case scenario is a lookup table, which is technically constant space). Converting a list of floating-point numbers to integers, Radix sorting those integers, and converting the resulting list back to floating point, we now have a sorting algorithm for floating-point numbers that runs in linear time and space.</p>
<p>Why is this algorithm not used more often? Have I missed something vital?</p>

CC BY-SA 4.0
2024-05-28T05:45:46.317Z
Please ask only one question per post.  If you have two questions, they can be asked separately (but your second question is not research-level and is answered in many standard resources).  Thank you!
D.W.
CC BY-SA 4.0
2024-05-28T06:28:10.327Z
This is the wrong forum to ask this question because it is not research-level. Please delete it here and ask on https://cs.stackexchange.com. Thanks!
Andrej Bauer
<time-complexity><sorting>
Possibility to Use Radix Sort for Linear Sorting of Floating Point Numbers?
Flummox
# Possibility to Use Radix Sort for Linear Sorting of Floating Point Numbers?

(Asked by: username_0 on 2024-05-28)

Radix sort is a sorting algorithm that runs in linear time because it doesn't use algebraic comparisons. Its main limitation is that, because of this, it can only sort integers. However, a 32-bit floating-point number and a 32-bit integer can hold the same number of values, so there exists a theoretical conversion between the two that preserves comparison operators (worst case scenario is a lookup table, which is technically constant space). Converting a list of floating-point numbers to integers, Radix sorting those integers, and converting the resulting list back to floating point, we now have a sorting algorithm for floating-point numbers that runs in linear time and space.

Why is this algorithm not used more often? Have I missed something vital?

**Tags:** time-complexity, sorting

> **Comments:**
> **username_1**: Please ask only one question per post.  If you have two questions, they can be asked separately (but your second question is not research-level and is answered in many standard resources).  Thank you!  
> **username_2**: This is the wrong forum to ask this question because it is not research-level. Please delete it here and ask on https://cs.stackexchange.com. Thanks!  

---

## 0 answers

