Guest User

Untitled

a guest
May 20th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
  2.         Call transfert_Tableau_Tableau(T1, n, T2)
  3.         debut = DateAndTime.Timer
  4.         Call InsertionSort(T2, n - 1) 'tri_insertion_recursif_permutation(T2, n - 1)
  5.        Call transfert_Tableau_Liste(T2, n, ListBox2)
  6.         Label5.Text = Format(DateAndTime.Timer - debut, "0.000 s")
  7.     End Sub
  8.  
  9.  
  10.  
  11.  
  12. Public Sub InsertionSort(ByRef ArrayAngka() As Long, ByVal n As Integer)
  13.         Dim i, j As Integer
  14.         For i = 0 To (n - 1)
  15.             For j = i + 1 To 1 Step -1
  16.                 If ArrayAngka(j) < ArrayAngka(j - 1) Then
  17.                     Call tukar(ArrayAngka(j), ArrayAngka(j - 1))
  18.                 End If
  19.             Next j
  20.         Next i
  21.     End Sub
  22.     Private Sub tukar(ByVal data1 As Long, ByVal data2 As Long)
  23.         Dim temp As Long
  24.         temp = data1
  25.         data1 = data2
  26.         data2 = temp
  27.     End Sub
Add Comment
Please, Sign In to add comment