The main topic of week4 is recursion, as mentioned
before in my week4 SLOG. Recursion means using the function itself in a
particular function as a helper function. In the lecture section, practices
were done to give me a straightforward understanding of recursion.
After tracing a list with depth of 1, we
believe that the function works well on this kind of list. So we won’t bother tracing
the list with depth 1 in other lists afterwards. Then we can work on lists with
depth 2, 3, 4 and so on. This is the concept of recursion. Proving the former
one also proves the next step. Recursion in programming is like complete
induction in math. This is where I feel csc148 is related to other course
tightly—being thoughtful and organized is required in these courses.
No comments:
Post a Comment