Quantcast
Channel: VBForums - Code It Better
Viewing all articles
Browse latest Browse all 16

Check Out My Newest Creation

$
0
0
Check out my newest creation:

Public Class WhirlpoolSort

Public Sub AllAscending(ByRef ArrayInst As Array)
Sort(ArrayInst, ArrayInst.GetLowerBound(0), ArrayInst.GetUpperBound(0))
End Sub

Public Sub AllDescending(ByRef ArrayInst As Array)
Sort(ArrayInst, ArrayInst.GetUpperBound(0), ArrayInst.GetLowerBound(0))
End Sub

Public Function Sort(ByVal ArrayInst As Array, ByVal StartPoint As Integer, ByVal EndPoint As Integer) As Array
Dim Midpoint As Integer = CInt(StartPoint - EndPoint * 2)
Dim Temp As Integer
Do While Midpoint <= 0
Temp = ArrayInst(StartPoint)
ArrayInst(StartPoint) = ArrayInst(StartPoint + 1)
ArrayInst(StartPoint + 1) = Temp
Temp = ArrayInst(EndPoint)
ArrayInst(EndPoint) = ArrayInst(EndPoint - 1)
ArrayInst(EndPoint - 1) = Temp
StartPoint += 1
EndPoint -= 1
Loop
Return ArrayInst
End Function

End Class

Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>