thank you Richard for the response, how if using code like this in the data grid view Public Sub Quicksort(ByVal list() As Integer, ByVal min As Integer, ByVal max As Integer) Dim random_number As New Random Dim med_value As Integer Dim hi As Integer Dim lo As Integer Dim i As Integer ' If min >= max, the list contains 0 or 1 items so ' it is sorted. If min >= max Then Exit Sub ' Pick the dividing value. i = random_number.Next(min, max + 1) med_value = list(i) ' Swap it to the front. list(i) = list(min) lo = min hi = max Do ' Look down from hi for a value < med_value. Do While list(hi) >= med_value hi = hi - 1 If hi <= lo Then Exit Do Loop If hi <= lo Then list(lo) = med_value Exit Do End If ' Swap the lo and hi values. list(lo) = list(hi) ' Look up from lo for a value >= med_value. lo = lo + 1 Do While list(lo) < med_value lo = lo + 1 If lo >= hi Then Exit Do Loop If lo >= hi Then lo = hi list(hi) = med_value Exit Do End If ' Swap the lo and hi values. list(hi) = list(lo) Loop ' Sort the two sublists. Quicksort(list, min, lo - 1) Quicksort(list, lo + 1, max) End Sub
U
User 13544494
@User 13544494
Posts
-
Implement a quick sort algorithm in Data Grid View with button1 -
Implement a quick sort algorithm in Data Grid View with button1I'm having trouble with a quick sort algorithm, which is where the grid view data is required to sort by quick sort, and I have 1 table that contains: id_mk, name, address I want to sort id_mk in grid view data results using quick sort with the help of button1 and this id_mk contains the data type string. I thank you for reading this problem, and I hope there is someone who can help me. :) :) :) regards andref