Recursion is a brand new idea to me. I have learned a bit of Java before the course CSC108 and CSC148. the strategy to implement Recursion code itself is not hard, it is the concept it is hard to understand. You write a function, and call the function inside the function itself. It could be infinite depth, depends on the argument you put in. It is challenging because we human don't usually understand things like that, when we do something, we think about what happens next, not what happens inside the things that just happened. It is a efficient way, but also abstract.
However, I found out that recursion can be related to a very famous movie: Inception. The movie is about a thief with that steals secrets from people's dreams. But somehow he got trapped in his own dream, that is a dream inside a dream, which is very dangerous, cause you could be trapped in there forever, and there can always be another level of dream inside that dream. Can you see the similarity between the movie and recursion? Yes, it could be so deep that you can't even imagine.
Coding is interesting.
No comments:
Post a Comment