Jump to content

Sorting algorithms/Strand sort: Difference between revisions

m
Small improvements in the D entry
(→‎{{header|C}}: modularize, sort of)
m (Small improvements in the D entry)
Line 231:
 
=={{header|D}}==
<lang d>import std.stdio, std.range, std.container, std.algorithm;
<lang d>import std.stdio, std.range, std.container, std.algorithm;
 
DList!T strandSort(T)(DList!T list) {
Line 273 ⟶ 272:
void main() {
auto lst = DList!int([-2,0,-2,5,5,3,-1,-3,5,5,0,2,-4,4,2]);
//auto lst = DList!int([-2,-2, 1]);
foreach (e; strandSort(lst))
writefwrite("%de, ", e");
}</lang>
{{out}}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.