Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

REXX Bubble sort

272 views
Skip to first unread message

cap...@crunch.com

unread,
Apr 3, 1999, 3:00:00 AM4/3/99
to
Does anyone have working code for a REXX sort using the Bubble
algorithm. I am attempting to sort a STEM with numerical values in
descending order. Any other sort algorithms written in TSO REXX would
be appreciated.

Thanks,

REXX Rookie

Jerry McBride

unread,
Apr 4, 1999, 4:00:00 AM4/4/99
to

I managed to find a REXX IDE that has this available as a built-in template and
it's never let me down. Hope it helps you.

/*============[Bubble sort]============*/

BubSort: Procedure Expose stem.

Do i = stem.0 To 1 By -1 Until flip_flop = 1
flip_flop = 1
Do j = 2 To i
m = j - 1
If stem.m > stem.j Then Do
xchg = stem.m
stem.m = stem.j
stem.j = xchg
flip_flop = 0
End /* If stem.m ... */
End /* Do j = 2 ... */
End /* Do i = stem.0 ... */

Return ''

/*** End BubSort ***/

--

/--------------------\
| Jerry McBride |
| mcbr...@erols.com |
\--------------------/


Rex Swain

unread,
Apr 6, 1999, 3:00:00 AM4/6/99
to
See
http://www.pcnet.com/~rhswain/sortstem.rex
for several stem sorting algorithms.

In article <37066e22...@news.autobahn.mb.ca>, cap...@crunch.com wrote:
>Does anyone have working code for a REXX sort using the Bubble
>algorithm. I am attempting to sort a STEM with numerical values in
>descending order. Any other sort algorithms written in TSO REXX would
>be appreciated.

__________________________________

Rex Swain ; Independent Consultant
Tel: 860-868-0131 ; Fax: 860-868-9970
Mail: 8 South Street ; Washington, CT 06793 ; USA
Email: rhs...@acm.org ; Web: http://www.pcnet.com/~rhswain

Joe Hunter

unread,
Apr 6, 1999, 3:00:00 AM4/6/99
to cap...@crunch.com
You can find several examples of sorting techniques in the REXX Tips and
Techniques documents available in many locations such as Hobbes, and Leo.

Joe Hunter

cap...@crunch.com wrote:

> Does anyone have working code for a REXX sort using the Bubble
> algorithm. I am attempting to sort a STEM with numerical values in
> descending order. Any other sort algorithms written in TSO REXX would
> be appreciated.
>

> Thanks,
>
> REXX Rookie


0 new messages