Я предоставлю вам решение для этого, но для сортировки чисел вам нужно всего лишь изменить логику сравнения, чтобы определить, какая строка больше другой.
шаг-1: скопировать элементыиз списка в массив ар.шаг 2: используйте быструю сортировку:
Private quickArr() As Integer
Public Sub QuickSort(ByVal arr() As Integer)
quickArr = arr
DoQuickSort(0, arr.Length - 1)
End Sub
Private Sub DoQuickSort(ByVal low As Integer, ByVal high As Integer)
Dim i As Integer = low
Dim j As Integer = high
Dim pivot As Integer = Math.Ceiling(quickArr(((low + high) / 2))) 'pivot is the middle element(ceiling)
mMoves += 1
While i <= j
While quickArr(i) < pivot
i += 1
End While
While quickArr(j) > pivot
j -= 1
End While
If i <= j Then
Dim t As Integer = quickArr(i)
quickArr(i) = quickArr(j)
quickArr(j) = t
i += 1
j -= 1
mMoves += 2
End If
End While
If low < j Then
DoQuickSort(low, j)
End If
If i < high Then
DoQuickSort(i, high)
End If
End Sub
3 - скопируйте массив resuly обратно в список