I have the following values in 1d array: You can read these items from right to left, I mean 5 / 1 is read as one slash five. When used bubble sort method to sort this 1d array, I got the values sorted but not as expected
Code: Select all
Sub BubbleSort(myArray() As Variant)
Dim temp, i As Long, j As Long
For i = LBound(myArray) To UBound(myArray) - 1
For j = i + 1 To UBound(myArray)
If myArray(i) > myArray(j) Then
temp = myArray(j)
myArray(j) = myArray(i)
myArray(i) = temp
End If
Next j
Next i
End Sub