Sorting algorithms/Bubble sort: Difference between revisions

m
little change in code
(added FreeBasic example)
m (little change in code)
Line 1,415:
' array's can have subscript range from -2147483648 to +2147483647
Dim As Integer lb = LBound(bs)
Dim As Integer ub = UBound(bs) -1
Dim As Integer done, i
 
Do
done = 0
For i = lb To ub - 1
' replace "<" with ">" for downwards sort
If bs(i) > bs(i + 1) Then
Line 1,427:
End If
Next
ub = ub -1
Loop Until done = 0
 
457

edits