On 2018-02-07, at 16:01:14, Glen wrote:

> Someone [Bernd] wrote:
> 
>   "yes, I Had to do the Same, when I implemented Quicksort in REXX, because
>    the OS/2 Implementation of REXX only supported some 32 nesting Levels."
>    [ < http://bernd-oppolzer.de/blog_20150115_151000.htm > ]
> 
> The usual way to write recursive quicksort is to take advantage of tail 
> recursion.
> Each call will generate two recursive calls for two partitions of the input.
> One is done with an actual recursive call, and the other, which would normally
> occur just before return, is done with a branch back to the top.
> This is tail recursion elimination.
> 
> If the smaller partition is done with a recursive call, it is guaranteed to
> be smaller than half the input, so at most log2(N) levels of recursion.
>  
Works great!  Thanks!

Bernd, would you like a copy of my updated version?

-- gil

Reply via email to