Sorting algorithms/Bubble sort: Difference between revisions
Content added Content deleted
m (→{{header|Pascal}}: indentation) |
|||
Line 1,485:
=={{header|Mathematica}}==
<lang Mathematica>bubbleSort[{w___, x_, y_, z___}] /; x > y := bubbleSort[{w, y, x, z}]
bubbleSort[sortedList_] := sortedList</lang>
Example:
<
▲<lang Mathematica>{1, 3, 3, 4, 7, 8, 9, 10, 13}</lang>
=={{header|MATLAB}}==
|