A Tree is an abstract data type used to simulate hierarchical structures in computer science. It is essentially made up of nodes/vertices and non-cyclical directed edges. A non-empty tree has one root node and potentially many levels of additional nodes that form a hierarchy. A node usually has a value and subtrees of children, often represented as a collection or a set of linked nodes. In this article we will explore different types of trees and their applications.
Simply put, OOP is a fundamental computer programming style that aims to store data in self contained structures called objects, which may or may not perform actions (a different approach from function or procedural programming). Following this pattern, programs are designed so that objects can interact with one another. There are a few different approaches for OOP, however the most popular implementations are class-based, where objects are instances of classes.
Recursion is one of the main ideas in computer science. Tracing recursive functions is a great way to discover how they behave when you are learning, developing, or troubleshooting them. Once you become comfortable, you will rarely need to trace it again as you start to trust your functions will work automagically... big mistake!
This semester I started a new course at UofT - Introduction to Computer Science. The course uses python and among other things, it is supposed to teach students how to think scientifically about program design concepts such as modularity, encapsulation, recursion, linked structures, efficiency, etc.
Writing blogs isn't a task for everyone. It wasn't easy for me to write my first blog post. It took me a while to find a topic that I would be comfortable enough to write about. They seemed either too basic, so that you would not be interested on, or way too specif, so that you would not understand anything I was writing about or it would take me a lifetime to get it right.
Nevertheless, I took courage, picked a topic, and soon I was striking my first words in a notepad. I wanted to make it interesting and easy to read yet fun to keep your fullest attention. After a couple of hours in front of the computer I was finally done. Uff... what a relief - I thought I would never go through this pain again, but...