Sorting algorithms/Bubble sort: Difference between revisions

Simplified
(→‎{{header|C++}}: use swap to swap! Also, no args to main() to avoid compiler warnings (gcc -Wall))
(Simplified)
Line 1,645:
 
=={{header|PicoLisp}}==
<lang PicoLisp>(de bubblesortbubbleSort (Lst)
(let (Len (length Lst) use Chg)
(loop
(off Chg)
(mapfor (L Lst (cdr L) (cdr L))
'(when (> (car L) (Ncadr L))
(when (> (carxchg L) (cadrcdr L))
(xchgon LChg) (cdr) L))
(on Chg) ) )
(range 1 (dec 'Len))
Lst )
(NIL Chg Lst) ) ) )</lang>
 
Anonymous user