Monday, 3 February 2014

Intro to Recursion

     In the last set of CSC148 lectures we were introduced to recursion, which at the time I knew nothing about other than "it is a technique used to solve problems". Due to my (terrible) lack of knowledge of the subject I decided to google "recursion" to learn more about the topic, and found something interesting. After I made sure I typed in recursion correctly, google still suggested this:
At first I didn't know that this was done purposely by google, but after further investigation of recursion I knew why google decided to add this little "easter egg". 
     I now understand that recursion involves some sort of repetition (because clicking the suggestion in google led to the same page). When implemented in programming to for example, a function, it would mean allowing a function to call itself.
     The example we did in class using Python's turtle also helped me understand recursion but in a more visual sense. We commanded these drawing turtles to draw "tree bursts" starting with the base case of level 1 then gradually increasing the levels too see how recursion was being represented. As the levels increased, I saw that the level 1 tree burst was being used to draw the level 2, and 3 and so on.. tree bursts. From this, I understood that when facing a recursive problem, it's solution will come from solutions to smaller or the most basic instances of the same problem.
     With that being said, my goal this week and perhaps next week will be to master recursion, which will not just help me complete our first CSC148 assignment, but will help me in many ways throughout my computer-programming journey.

2 comments:

  1. I'm not too sure why, but I found the google thing mind boggling (after trying it myself) :D sorry if this is terribly random, I was just checking out some other student's slogs, y'know from the course homepage where it links 'em all, and I accidentally clicked follow on ur page.. and then unclicked it… and then stared at the screen... ;__; sorry bout that

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete