I just had my test this week and I'm nervous about the results. So to take my mind of it, I'm preparing for my next week's tutorial.
More recursive stuff. Which reminds me of the test. But I think I did well on that part...that is if I didn't make any stupid mistakes.
Anyways, for this week, there is this 'flatten' definition. Usually just staring at recursive definitions, I don't really understand it because the function is in the definition (which is defining that particular function)... Before encountering recursive functions, I would normally use the function and see what kind of results it generates and that was how I understood the past functions. But with recursive functions, even going through multiple definitions, I didn't really understand it.
So how I went about understanding recursive functions was using the Stepper. (I'm so glad I went through that before going into my test on Wednesday for the recursive functions that were taught previously). By going through the Stepper, it is so much easier seeing how the overall function works. Basically, each time the definition uses the function it is defining, it brings a 'smaller' part of whatever the function was processing back to the beginning of the definition. As previously mentioned, I'm a visual learner, so this Stepper function really helped me to understand the flatten function (and the other recursive functions).
Glad the stepper worked out.
ReplyDelete