Saturday, March 29, 2014

Sorting and Efficiency

Different computers have different processing powers and therefore can handle certain tasks at different speeds, this makes it useless to test the efficiency of a function/program based on its runtime on a single machine. Instead, algorithm efficiency is analysed based on the variation in resource use as the size of the processed input (n) varies. The runtime is calculated in relation to the input size (n) and is simplified to the highest degree. This is expressed in Big-Oh notation "O(n)". The big-Oh notation is used as a universal measure of the efficiency of a function regardless of machine power.

There are different implementations of sorting algorithms that differ in structure, built-in-function use and runtime efficiency. Some algorithms are more efficient than others with inputs of a smaller size and vice versa. Their efficiencies are recorded in Big-Oh notation based on a variety of inputs of different size (n). 

Saturday, March 1, 2014

Coding Inception?!

Inifinite Depth Recursion
Inception! - That was my first thought when we were introduced to recursion. A function within itself, just like a dream within a dream right? And so it seems. I actually enjoyed working with recursion, it was a new interesting concept and I liked the challenge as we had to twist our minds to think of the object within itself.
Finally, after a couple of labs, I'm getting the hang of it. At first it was difficult to mentally process how and when to end the function and place a return statement, but visualizing the process on every element and sub-element was the key.


Now I'm working on A2. Usually our assignments entail coding function which are easier to test rather than classes, since they are more clear-cut and definite in terms of their requirements, process and output. Classes are pretty vauge on what they do, or at least that's what the A2 handout seems like, so now I'm trying to figure out if the implementation that I have for the Regex and RegexTree classes are what we need to hand in. I'm thankful that the second part of the assignment doesn't depend on the classes that we design!


Oh, and last Monday a random girl came and sat next to me in the 10am class, she didn't introduce herself, say good morning or even hi! She just jumped in to ask about how A2 was going then she sat there for the hour in silence drinking her Tim Horton's coffee not even taking notes in the class, and as soon as class ended she ran off! I found that peculiar but I certainly would have liked to talk to her more. To the girl that shall remain unnamed: if  you read this please say hi? :)


Monday, February 3, 2014

Sorting Cheese. That's what I learn from CSC!

As simple as the concept may be, it is interesting to see how it ties in to a classic game: The Tour of Hanoi, and how it can be see from the perspective of a Pythonista!
Well, I never though that coming into UofT I would say that I'm learning how to sort cheese.

Today I've spent about 5 hours straight working on A1. This is how I know I want to be studying Computer Science. Yes, it can get frustrating sometimes if the code doesn't work and you can't figure out why, but the joy that comes when you figure it out...! I know this may be applied to any subject or hobby, but I guess that's the point.
I managed to get through most of the assignment, with the GUI and Console controllers working and completing the game.
This was a productive start to the week. :) 

Sunday, January 26, 2014

Object-Oriented Programming

The first two weeks into the course were not really challenging, considering we had learned the bases of classes in CSC108 last semester. It was interesting, though, to see how some of the things we had learnt were challenged; the type contract is now not necessary to be part of the docstring, and we could create classes that inherit methods from other classes.
So far I find keeping up with 148 is more challenging than 108. The online videos and labs were pretty helpful. They were good references and the videos were easier to follow than the online notes that we have for 148. Non the less, it's not too bad.

We're only getting started, so buckle up!