Sorting algorithms/Quicksort: Difference between revisions
Content added Content deleted
m (→version 1: added wording to the REXX version section header.) |
m (→{{header|REXX}}: added a comment to the REXX section header.) |
||
Line 6,182:
===version 1===
This REXX version doesn't use or modify the program stack.
It is over '''400%''' times faster then the 2<sup>nd</sup> REXX version (using the exact same random numbers).
<lang rexx>/*REXX program sorts a stemmed array using the quicksort algorithm. */
call gen@ /*generate the elements for the array. */
Line 6,421 ⟶ 6,424:
{{trans|Python}}The Python code translates very well to [[ooRexx]] but here is a way to implement it in classic REXX as well.
This REXX version doesn't handle numbers with leading/trailing/embedded blanks, or textual values that have blanks (or whitespace) in them.
<lang Rexx> a = '4 65 2 -31 0 99 83 782 1'▼
<lang Rexx>
/*REXX*/
do i = 1 to words(a)
queue word(a, i)
|