Sorting algorithms/Bubble sort: Difference between revisions

J
(efficient CL implementation for vectors and lists)
(J)
Line 541:
Just xs2 -> Just $ x:xs2
_bsort _ = Nothing</lang>
 
=={{header|J}}==
<lang J>bubbleSort=: verb define^:_
for_n.i.(#y)-1 do.
pair=. y{~0 1+n
if. >!.0/pair do.
y=.pair (1 0+n)}y
end.
end.
y
)</lang>
 
=={{header|Java}}==
6,962

edits