|
|
|
Click here to copy the following block |
Dim S1(L To R) As String Dim P1(L To R) As Long Dim L1(L To R) As Long For I = L To R S1(I) = GetRandomString() P1(I) = I L1(I) = GetRandomLong() Next I
pSelSortS L, R, S1, P1 SelSortL L, R, L1
Sub pSelSortS(L As Long, R As Long, A() As String, P() As Long) Dim I As Long Dim J As Long Dim Min As Long Dim TMP As Long
For I = L To R - 2 Min = I For J = I + 1 To R If A(P(J)) < A(P(Min)) Then Min = J End If Next J TMP = P(I) P(I) = P(Min) P(Min) = TMP Next I End Sub
Sub SelSortL(L As Long, R As Long, A() As Long) Dim I As Long Dim J As Long Dim Min As Long Dim TMP As Long
For I = L To R - 2 Min = I For J = I + 1 To R If A(J) < A(Min) Then Min = J End If Next J TMP = A(I) A(I) = A(Min) A(Min) = TMP Next I End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|