[
next
] [
prev
] [
prev-tail
] [
tail
] [
up
]
Radix sort
r is radix,
x
%
r,
(
x
%
r
2
)
∕r,
(
x
%
r
3
)
∕r
2
get each digit from least significant digit (LSD) radix sorts to most significant digit.
int
i
;
int
k
;
while
(
i
%10){
k
=
i
%10;
i
=
i
/10;
}
according to r, prepare two arrays buckets A, B.
Sort according to one position and put them into A array buckets.
loop through A array buckets, and get next position digit. and then according to its value put into B array buckets.
swap A,B two array, then goto step 2.
[
next
] [
prev
] [
prev-tail
] [
front
] [
up
]