Sorting algorithms/Bubble sort: Difference between revisions
m
→{{header|Standard ML}}: fix syntax highlighting
imported>Arakov |
m (→{{header|Standard ML}}: fix syntax highlighting) |
||
(One intermediate revision by one other user not shown) | |||
Line 7,458:
=={{header|Standard ML}}==
Assumes a list of integers.
<syntaxhighlight lang="sml">
fun bubble_select [] = []
| bubble_select [a] = [a]
Line 7,466:
fun bubblesort [] = []
| bubblesort (x::xs) =bubble_select (x::(bubblesort xs))
</syntaxhighlight>
=={{header|Stata}}==
Line 7,778:
=={{header|Wren}}==
Based on the pseudo-code in the Wikipedia article.
<syntaxhighlight lang="
var n = a.count
if (n < 2) return
Line 7,795:
}
var
for (a in
System.print("Before: %(a)")
bubbleSort.call(a)
|