Sorting algorithms/Shell sort: Difference between revisions
m
→{{header|Wren}}: Minor tidy
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
m (→{{header|Wren}}: Minor tidy) |
||
(One intermediate revision by one other user not shown) | |||
Line 3,694:
End Sub'</syntaxhighlight>
=={{header|V (Vlang)}}==
<syntaxhighlight lang="v (vlang)">fn shell(mut arr []int, n int) {
mut j := 0
for h := n; h /= 2; {
Line 3,725:
=={{header|Wren}}==
Based on the Wikipedia article pseudo-code.
<syntaxhighlight lang="
var n = a.count
var gaps = [701, 301, 132, 57, 23, 10, 4, 1]
Line 3,743:
}
var
for (a in
System.print("Before: %(a)")
shellSort.call(a)
Line 3,762:
Alternatively we can just call a library method.
{{libheader|Wren-sort}}
<syntaxhighlight lang="
var
for (a in
System.print("Before: %(a)")
Sort.shell(a)
|