Sorting Algorithms/Circle Sort: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) (Added Perl example) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: fixed output error) |
||
Line 986: | Line 986: | ||
my @a = <16 35 -64 -29 46 36 -1 -99 20 100 59 26 76 -78 39 85 -7 -81 25 88>; |
my @a = <16 35 -64 -29 46 36 -1 -99 20 100 59 26 76 -78 39 85 -7 -81 25 88>; |
||
while (circlesort(\@a, 0, $#a)) { |
while (circlesort(\@a, 0, $#a)) { print join(' ', @a), "\n" }</lang> |
||
{{out}} |
{{out}} |
||
<pre>-99 -78 16 20 36 -81 -29 46 25 59 -64 -7 39 26 88 -1 35 85 76 100 |
<pre>-99 -78 16 20 36 -81 -29 46 25 59 -64 -7 39 26 88 -1 35 85 76 100 |