[plt-scheme] Re: HTDP Exercise 12.4.2 ... Help! (Solved!!)

From: Todd O'Bryan (toddobryan at gmail.com)
Date: Sun May 3 15:33:35 EDT 2009

Skip it and come back. This problem is very tough and some of the
later problems might make it easier for you, especially some of the
binary tree stuff, because you think about recursion in a different
way.

Also, Part IV doesn't necessarily require most of Part III, and I
think it's some of the neatest stuff in the book. You might start
there and drop back into Part III when you feel the need for a
challenge.

Todd

On Sun, May 3, 2009 at 11:31 AM, mike <anesward at mac.com> wrote:
> I admire your persistence ; I became so discouraged that i haven't
> looked at
> htdp since early april; So i have to pick myself up and get back to
> it.
> mike
>
> On May 2, 7:34 pm, S Brown <ontheh... at gmail.com> wrote:
>> I just wanted to update this topic in order to say that I have finally
>> solved this exercise the *correct* way! Thank you very much to
>> everyone here who provided input.
>>
>> For anyone who finds this topic and is looking for help with this
>> exercise:
>>
>> 1. Learn the right way to think about recursion. Don't make the
>> mistake I made and try to put the entire recursive process into your
>> head all at once. It simply doesn't work. Even writing down all of the
>> results of the recursion step-by-step won't help. Instead, use the
>> definition of the function itself to understand how the recursion
>> works, and then create the rest of the function as if the recursive
>> call already does what it's supposed to do.
>>
>> 2. Follow the design recipes. This exercise is probably the first one
>> in the book where you pretty much have to use the design recipes in
>> order to find the right solution. The specific recipe you should be
>> looking at here is in section 9.4
>>
>> 3. Walk away from this exercise if/when you get frustrated. Take a
>> walk, watch a movie, etc. Basically, go do something that doesn't
>> require a lot of thinking.
>>
>> 4. Don't give up on it until you have the solution. It's worth it once
>> you solve it because you gain a better understanding of how to use and
>> think about recursion, and how to use the design recipes.
>> _________________________________________________
>>   For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.