how to write a subrouting to perfome ripple sort on the elements of a character array

10 pts.
Tags:
Character arrays
Development
how to write a subrouting to perfome ripple sort on the elements of a character array. this character is called A and must be the parameter of the subroutine. information about whether the array starts at 0 or 1 as well as the size is not known. the sorted array must be available to the caller once the subroutine has sorted.

Answer Wiki

Thanks. We'll let you know when a new response is added.

‘Ripple Sort – traverse the array and interchange if in the wrong order
Public Sub RippleSort(A() As String) As String()
Dim NumOfEntries As Long, NumOfTimes As Long, i As Long, j As Long
NumOfEntries = UBound(A)
NumOfTimes = NumOfEntries – 1
For i = LBound(A) To NumOfTimes
For j = i + 1 To NumOfEntries
If A(j) < A(i) Then Swap A(j), A(i)
Next j
Next i
RippleSort = A
End Sub

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: