Sorting algorithms/Bubble sort: Difference between revisions

no edit summary
(→‎{{header|Julia}}: A new entry for Julia)
No edit summary
Line 3,064:
v <- c(9,8,7,3,1,100)
print(bubblesort(v))</lang>
 
=={{header|Ra}}==
<lang Ra>
class BubbleSort
**Sort a list with the Bubble Sort algorithm**
on start
args := program arguments
.sort(args)
print args
define sort(list) is shared
**Sort the list**
test
list := [4, 2, 7, 3]
.sort(list)
assert list = [2, 3, 4, 7]
body
last := list.count - 1
post while changed
changed := false
for i in last
if list[i] > list[i + 1]
temp := list[i]
list[i] := list[i + 1]
list[i + 1] := temp
changed := true
</lang>
 
=={{header|Racket}}==
Anonymous user