Sorting algorithms/Cocktail sort: Difference between revisions

Content added Content deleted
(Added Arturo implementation)
Line 2,527: Line 2,527:
<pre>[0,0,2,3,3,8,17,36,40,72]</pre>
<pre>[0,0,2,3,3,8,17,36,40,72]</pre>


=={{header|Mathematica}}==
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<lang Mathematica>cocktailSort[A_List] := Module[ { swapped = True },
<lang Mathematica>cocktailSort[A_List] := Module[ { swapped = True },
While[ swapped == True,
While[ swapped == True,