123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home

Source Codes

Engineering Colleges

BE Students

Training  Reports (updated)

Seminar Reports (updated

Placement Papers (updated)

Forums

   Computer Science / IT

   Electronics

   Electrical

   Mechanical

   Chemical

   Civil

   CAT / MBA

   GMAT / Foreign MBA

Latest Jobs

Engineering Jobs / Technical Jobs

Management Jobs

Sitemap

About-Us

Terms of use

Displaying  Source Code(s)  
 

 
SelectionSort Function

--------------------------------------------------------------------------------

Description : The SelectionSort function sorts an array alphabetically (A - Z) or numerically (low to high). SelectionSort expects an array as input.

<%
Private Function SelectionSort(ByVal unsortedarray)
Dim Front, Back, I, Loc, Selcom
Dim Temp, Selswap, Arrsize
Arrsize = UBound(unsortedarray)
For Front = 0 To Arrsize - 1
Loc = Front
For Back = Front To Arrsize
Selcom = Selcom + 1
If unsortedarray(Loc) > _
unsortedarray(Back) Then
Loc = Back
End If
Next
Selswap = Selswap + 1
Temp = unsortedarray(Loc)
unsortedarray(Loc) = unsortedarray(Front)
unsortedarray(Front) = Temp
Next
SelectionSort = unsortedarray
End Function
%>

 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG