Skip to content

Commit e3b3fb5

Browse files
committed
Fix radix_sort.go
1 parent 8fc0446 commit e3b3fb5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/go/radix_sort.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ func RadixSort(slice []int) {
2424
var bucket [10]int
2525

2626
for index := 0; index < length; index++ {
27-
bucket[(slice[index]/exp)%10]++
27+
bucket[(slice[index]/exp)%10]++
2828
}
2929

3030
for index := 1; index < 10; index++ {
31-
bucket[index] += bucket[index-1]
31+
bucket[index] += bucket[index-1]
3232
}
3333

3434
for index := length - 1; index >= 0; index-- {
35-
bucket[(slice[index]/exp)%10]--
35+
bucket[(slice[index]/exp)%10]--
3636
temp[bucket[(slice[index]/exp)%10]] = slice[index]
3737
}
3838

3939
for index := 0; index < length; index++ {
4040
slice[index] = temp[index]
4141
}
4242

43-
exp *= 10
43+
exp *= 10
4444
}
4545
}
4646

0 commit comments

Comments
 (0)