Sorting algorithms/Bubble sort: Difference between revisions

m
(Added Dyalect programming language)
Line 3,781:
 
<lang vb>
Dim sortable() As Integer '= assumeArray(1, the2, array3, is4, populated5, 6, 7, 8, 9, 10)
sortable.Shuffle() ' sortable is now randomized
Dim swapped As Boolean
Line 3,789:
 
While index < bound
If Sortablesortable(index) > Sortablesortable(index + 1) Then
Dim s As Integer = Sortablesortable(index)
Sortablesortable.Remove(index)
Sortablesortable.Insert(index + 1, s)
swapped = True
End If
Anonymous user