Sorting algorithms/Radix sort: Difference between revisions

m (syntax highlighting fixup automation)
Line 1,357:
=={{header|EasyLang}}==
 
<syntaxhighlight lang="text"># Radix sort - sorts positive integers
func sort . datad[] .
#
# radix = 10
func sort . data[] .
radix = 10256
formax d= in data[]0
for maxdi = higher1 dto maxlen d[]
if d[di] > max
max = d[di]
.
.
len buck[][] radix
pos = 1
while pos <= max
for i range= 1 to radix
len buck[i][] = [ ]0
.
for ddi in= data1 to len d[]
h = d[di] /div pos mod radix + 1
buck[h][] &= d[di]
.
di = 01
for i range= 1 to radix
for dj in= 1 to len buck[i][]
datad[di] = dbuck[i][j]
di += 1
.
Line 1,386 ⟶ 1,389:
data[] = [ 29 4 72 44 55 26 27 77 92 5 ]
call sort data[]
print data[]</syntaxhighlight>
</syntaxhighlight>
 
=={{header|Eiffel}}==
1,969

edits