‘To understand recursion, one must first
understand recursion'- made no sense to me initially. But now, I feel like I finally understand it. The moment that recursion clicked in my brain had to be one of the most euphoric moments in my life. My main issue with recursion was that was too accustomed to using loops to get what I want. Another issue I had was in not understanding what base cases to use and how they were utilized. Even the simple factorial function seemed convulated to me.
For recursion to work, we call a function within the same function. It involves a base case and a condition that calls on the function. It reminds me of induction, which is something we are learning in MAT137 and CSC165 now. Recursion simplifies the problem greatly and makes functions more efficient. I have learned that practice makes perfect in computer science. I now feel quite comfortable with recursion(even with base cases, which I struggled with so much). I went on Codeacademy for extra practice with recursion and that helped greatly. Now, I am finding recursion quite enjoyable. Creating functions using recursion is similar to solving puzzles.
I also had the midterm this week, which I thought went pretty well as I did study a lot for it over reading week, but we shall see how it went!