Anonymous user
Best shuffle: Difference between revisions
m
→{{header|Icon}} and {{header|Unicon}}: fix order + description
m (→{{header|Icon}} and {{header|Unicon}}: tweak comments) |
m (→{{header|Icon}} and {{header|Unicon}}: fix order + description) |
||
Line 419:
=={{header|Icon}} and {{header|Unicon}}==
The approach taken requires 2n memory and will run in O(n
Additionally, this can be trivially modified to randomize the shuffle.
<lang icon>procedure main(args)
while scram := bestShuffle(line := read()) do
|