Friday, February 28, 2014

Week 7- Linked Structure

A Tiny Review: What is Recursion in Python?

For the past few weeks in CSC148, we did a lot of recursions. Recursion is a method in which the function calls themselves within their definition. They can be used multiple times. Recursion shortens complex codes. It involves breaking the problem into smaller subparts and until it can be solved, which is also the base case. Without it, the program will not work since it would loop infinitely until the maximum recursion depth is reached in Python and returns with a runtime error.

To me, it is like finding the greatest common divisor.

For how to start with recursion, please refer to Week 4 - More Recursions!

Linked Lists!

So this week, we were taught how to design a class for Linked Lists.
Linked lists basically are like the Tree class discussed last week ().

No comments:

Post a Comment