Sunday 1 March 2015

5- A Summary of Recursion

This week we learned more about recursion and how to implement it into our classes for our program in the Tippy assignment. I feel like this week I have finally understood the concept of recursion without just memorizing the general skeleton of a recursive function.

In terms that aren't programming, recursion is what happens when you put two mirrors facing each other. The images inside the mirrors seems to go on infinitely, or, recursively. In terms of computer science, recursion is essentially defining a function in terms of the function. This makes the function loop on itself to solve problems such as having nested lists inside of a list.

During the first week of learning recursion, we used it to solve the nested list problem in order to get the max of said list and of the like. Now we are learning to use it in trees which can also be used in our program for our assignment which is very exciting to learn!

I am still not quite solid on trees yet, but I'm hoping if I use the Python Visualizer on a tree diagram when using a function on a method. I am also meeting with my Assignment 1 group today so I am hoping both their input and mine can help me understand recursion on trees a lot better.

No comments:

Post a Comment