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)  
 

 
CombSort Function

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

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

<%
Private Function CombSort(ByVal UnsortedArray)
Dim I, J, Temp, Gap, Swapped
Dim ArrSize, Combcom, Combswap
Const Shrink = 1.3
ArrSize = UBound( UnsortedArray )
Gap = Arrsize - 1
Do
Gap = Int(Gap / Shrink)
Swapped = True
Combcom = Combcom + 1
For J = 0 To Arrsize - Gap
If UnsortedArray(J) > UnsortedArray(J + Gap) Then
Temp = UnsortedArray(J)
UnsortedArray(J) = UnsortedArray(J + Gap)
UnsortedArray(J + Gap) = Temp
Swapped = False
Combswap = Combswap + 1
End If
Next
Loop Until Not Swapped And Gap = 1
CombSort = UnsortedArray
End Function
%>

 

 

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