Linear Sorting Algorithms

I am new to the study of algorithms - and I do not study computer science.
However, by reading linear comparison algorithms without comparison, I could understand that radix collation is an extension of collation. What I don't understand is the sort restriction. Why should I look for radix collation when the collation count seems to serve the purpose when I need to avoid O (n * logn) comparisons?
This seems to be a much simpler implementation.

+3
source share
5 answers

Imagine someone gave you a list of integers to sort. You know nothing about this except that it contains integers.

, . , -100 100, , , .

, , . ( , ), 2 * max_int ( ).

Radix , (0-9).

+3

( Radix) . , , "float" "double". , .

(, ) , , O (1). . N, O (log (N)). , Array [i] "i", "i" log (i). N (, 200 -100.100 ), , log (N) . , , (: 2 * MAX_INT) (2 * MAX_INT) (, 32). , , 100: A [100] . O (N * log (N)) O (100 * log (100)) . (Say 2 ^ 64 64 ). O (N * log (2 ^ 64)), O (100 * log ( 100)). , . , , - 2 ^ 64, , O (100 * log (100))... ...

: , O (N). :

O(MAX_INT) + O(N*log(MAX_INT))

, O(N*log(N)) N, . , , - (, -100..100)

O(MAX_INT) + O(N*log(MAX_INT))

O(200) + O(N*log(200)) ~ O(N)

Radix , log(), -X..X log (X) (MAX_INT), , log (N), N - , .

+2

O (max - min), min, max - , . , , , .

+1

, .
, . .
O(N).
, . , .
, , , , . , . , , , .

0

. First Radix Sort . , , .

op, , , . .

radix?

0

All Articles