Sorting algorithms/Sleep sort: Difference between revisions

m
Improved the formatting of the jq code
m (Fixed a typo in the jq code)
m (Improved the formatting of the jq code)
Line 724:
else
{ unsorted: [.unsorted[] | .t = .t - 1 | select(.t != 0)]
, sorted: (.sorted + [.unsorted[] | .t = .t - 1 | select(.t == 0) | .v])} | f
| f
end;
{unsorted: [.[] | {v: ., t: .}], sorted: []} | f | .[]
Anonymous user