General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
p11
Creel
comments
Comments by "p11" (@porky1118) on "Why is Radix Sort so Fast? Part 2 Radix Sort" video.
14:27 This one based count is nothing special. You often specify the beginning in a zero based way and the end in a one based way. I wouldn't even say, it's one based. You could add a zero index at the beginning, then every pair of ranges defines a left inclusive right exclusive range. (range from 0 (inclusive) up to 0 (exclusive) excludes the zero) I also wouldn't say, arrays are really zero based. Just don't use the indices as the array elements, but between them, similar to a fence. I think, this is a much better way to think about arrays. So the first array element is represented by the range 0..1, but you normally just write the beginning of the range, if it's zero based.
1
I wonder how well this works with floats or more complicated sorting conditions, which cannot be easily split into groups of ten.
1
How much RAM does radix sort require? O(n + m), where n is the count of the elements, you want to sort, and m is the maximum number of digits for each iteration (in this case 10). So m is in many cases not too much larger than n, most often probably smaller. When you sort i32, you'd probably use up to m=256 counts per iteration at maximum. The upper limit you might want to use for arrays elemens count is probably larger, so the required space is still O(n).
1