[racket] HtDP: Why is quick-sort considered generative recursion?

From: David Van Horn (dvanhorn at ccs.neu.edu)
Date: Fri Apr 22 22:22:37 EDT 2011

On 4/22/11 8:59 PM, Jay wrote:
>
> Hm...It's true that the main function doesn't conform to the usual
> recipe, but the auxiliaries do, right? I understand the rolling-ball and
> gcd examples, but this one still eludes me....
>
>

Yes, larger-items and smaller-items follow the structural recursion 
recipe, but quick-sort does not since it is recursively called on the 
result of another function, not on the rest of the input list.

David



Posted on the users mailing list.