Saturday, 28 February 2015

Recurring Recursion

As the hibernation/reading week ends, we continue to learn about recursion, but this time in a different class with a generic tree design called BTNode, allowing the process of recursion methods to be more visual.
Example of a recursive tree
Recall the definition of recursion as “defining something in terms of itself” usually at some smaller scale, perhaps multiple times, to achieve your objective. We can trace the steps of the call by making a diagram as this helps us with not only seeing how the parent and leave functions run, but also be how and in what order the valid codes are calculated. In evaluate method, the return result is the value after being calculated by the __init__ and __str___ provided in the tree. The simplest example of recursion in a tree is when the node is a leaf, which would involve another method in the class.

Saturday, 14 February 2015

It's complected: Trees and Relationships

Unlike being alone on valentines day, trees actually have real relationships, the most important use of a tree it's representation of hierarchical relationships. Used in structures of a program, relationships in an mathematical expression or directory structures. Trees are an ADT (abstract data type) which means that it has both a root value and several subtrees linked by nodes. One example of this is those binary fractal things that people can get on necklaces to give to their significant other if they had anyone.

Together with recursive functions, and understanding the core concepts of it, we are now able to expand our limitations and do so much more with Python.

Friday, 6 February 2015

Hibernation Cycles: Stacks and Queses

After every midterm, comes the post midterm days of hibernation for all the hours of sleep missed that has been accumulating for the last week followed by the brief enlightenment of finally being free for the next few short lived days of sweet ignorant freedom before it all comes crashing down again like some bad recursive function with a endless nested lists of midterms.

Sunday, 1 February 2015

Procrastination Nation: Assignment 1

And with a blink of an eye, it's midterms. Don't know if it's just the weather,  Friends being on Netflix this year, or the Superbowl on the Sunday before midterms this week, it seem like no one's really getting much done. And having my roommate's cat around constantly trying to sit on my laptop isn't exactly helping either.