[plt-scheme] HtDP exercise 29.1.1 | I don't understand ART.

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Jun 1 11:56:13 EDT 2010

On Jun 1, 2010, at 11:09 AM, Horace Dynamite wrote:
> Therefore, for a number tree containing N (nested) LISTs, I have at
> worst 2*N recursions to execute.

What is the N?

Why 2 * N? If it is 2 * N, yes O(N) is correct.

You do spawn two recursions at each stage, but draw a diagram before  
you jump to conclusions. Create a tree with 32 or 64 or 128 leaves  
well-distributed and not so well-distributed and imagine the function  
traversing this tree.

-- Matthias

Posted on the users mailing list.