Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
- Call transfert_Tableau_Tableau(T1, n, T2)
- debut = DateAndTime.Timer
- Call InsertionSort(T2, n - 1) 'tri_insertion_recursif_permutation(T2, n - 1)
- Call transfert_Tableau_Liste(T2, n, ListBox2)
- Label5.Text = Format(DateAndTime.Timer - debut, "0.000 s")
- End Sub
- Public Sub InsertionSort(ByRef ArrayAngka() As Long, ByVal n As Integer)
- Dim i, j As Integer
- For i = 0 To (n - 1)
- For j = i + 1 To 1 Step -1
- If ArrayAngka(j) < ArrayAngka(j - 1) Then
- Call tukar(ArrayAngka(j), ArrayAngka(j - 1))
- End If
- Next j
- Next i
- End Sub
- Private Sub tukar(ByVal data1 As Long, ByVal data2 As Long)
- Dim temp As Long
- temp = data1
- data1 = data2
- data2 = temp
- End Sub
Add Comment
Please, Sign In to add comment