Jump to content

Sorting algorithms/Bubble sort: Difference between revisions

m
→‎{{header|REXX}}: use better indentation for a DO group.
m (→‎{{header|REXX}}: changed some comments and added whitespace.)
m (→‎{{header|REXX}}: use better indentation for a DO group.)
Line 3,083:
do j=1 for n-1 /*sort M items this time around. */
k=j+1 /*point to the next item. */
if @.j>@.k then do /*is it out of order? */
_=@.j /*assign to a temp variable. */
@.j=@.k /*swap current with next. */
@.k=_ /*··· and next with _ */
done=0 /*indicate it's not done, */
end end /* 1=true 0=false */
end /*j*/
end /*j*/
end /*until done*/
Cookies help us deliver our services. By using our services, you agree to our use of cookies.