Sorting algorithms/Radix sort: Difference between revisions

Content added Content deleted
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 4,141: Line 4,141:
=={{header|Wren}}==
=={{header|Wren}}==
This is based on the approach used [https://www.geeksforgeeks.org/radix-sort/ here] which I've adjusted to deal with negative elements.
This is based on the approach used [https://www.geeksforgeeks.org/radix-sort/ here] which I've adjusted to deal with negative elements.
<syntaxhighlight lang="ecmascript">// counting sort of 'a' according to the digit represented by 'exp'
<syntaxhighlight lang="wren">// counting sort of 'a' according to the digit represented by 'exp'
var countSort = Fn.new { |a, exp|
var countSort = Fn.new { |a, exp|
var n = a.count
var n = a.count