Sorting algorithms/Quicksort: Difference between revisions
Content added Content deleted
(→{{header|Ruby}}: ++ sather (a sather guru likely can do it better and using methods or technics I dont know still)) |
m (→{{header|Sather}}: |.| instead of toarray(.)) |
||
Line 1,289:
=={{header|Sather}}==
<lang sather>class SORT{T < $IS_LT{T}} is
private afilter(a:ARRAY{T}, cmp:ROUT{T,T}:BOOL, p:T):ARRAY{T} is
Line 1,299 ⟶ 1,294:
loop v ::= a.elt!;
if cmp.call(v, p) then
filtered := filtered.append(
end;
end;
Line 1,315 ⟶ 1,310:
quick_sort(inout right);
res ::= #ARRAY{T};
res := res.append(left,
a := res;
end;
|