Total Pageviews

Wednesday, 27 November 2013

The new major requirement!

Now that the CSC major requirements have been changed I have to work extra hard now to get the best marks.

This did come as a shock to me because it happened so unusually. Usually I would expect such changes to occur starting next fall instead it happened midway this year.

I have been pretty paranoid these couple days. My mark in csc 148 is around the minimum required and as a result I have to really pick up my game and study all out for the final exam.

Tuesday, 19 November 2013

What is the point of Trees anyways?

This is a question that has come to my mind a lot when learning about tree structures. They seemed too weird,useless and pointless to me until I did a simple google. Apparently they are used in 3D video games to determine what objects need to be rendered. Tree structure are also used to organize information in database systems.

These answers still do not satisfy my curiosity but they do make me happy because now I know that I  didn't learn something that would be useless or only useful as "learning tools". Theres is actually important uses for these trees!!!

With binary trees it makes things very easy when dealing with big data. Being able to insert, remove or search becomes relatively fast. This way data can be recorded without taking too much space.

One way why this would be useful is when trying to use a quick way to sort data. You would insert data into a binary search tree at O(log(n)). Then traverse the tree in order to sort them. With binary tree's the left child is always less than the root and the right side is greater than the root. This really helps when sorting. 

Though I did get the impression that binary tree's are the most useful trees and that other basic tree's are not that practical to use. Tree's that use BSTNodes are (from what I read online) not relevant anymore aside from being used as learning tools. 


Sorry that I missed last week's deadline. That is why this week you get you enjoy a double entry :)

Post Midterm Thoughts + other languages

Before the midterm I was very nervous about recursion and tree structures. It seemed like an up hill battle. But after writing the exam I realized how my persistence finally worked out in the end. The midterm was quite easy for me and I felt really happy being able to easily set up the recursive functions.

Believing in the leap of faith was hard at times. Because trusting your programming to run when you do not fully understand it can be rather daunting. But I can finally say that I believe in this leap of faith.

In other news I have been looking forward to a course called csc 207. We learn Java in that course (which I have no experience on) and it seems that a bunch of my class mates already know how to do Java/C++ etc. Furthermore throughout  csc 148 I have heard about how much different Java is to Python.

I hope that Java does not present to be too much of a challenge. But at the same time even though the languages are different I hope that my learning of python benefits me when I am learning other languages like Java.

It is going to be interesting to learn how Java deals with whites space, recursion, tree structures, loops than compared to Python. A senior student was telling me that Python is easier to learn and is not that strict. Other languages are way more strict. Sounds kind of scary....but the fact that plenty of students I know from csc 148 have some background on C++ or Java does show me that it may not be as hard as it seems.

Monday, 4 November 2013

Assignment 2 + Bloated Code + New Tricks

Wow! Assignment 2 has sure been a crazy ride. I was certain this time that I would be able to work with 2 partners. But the unexpected happened as both my partners simultaneously dropped out of the course because they found the assignment 'too hard'. Now being stranded like this is rather annoying and depressing. But I was already working on the code and do not feel as bad as I would have if I had hardly began.

Although I must say that having the partners would have increased my chances of getting a really good mark.

Either way I must deal with this on my own :)

And speaking of crazy rides ... lets talk about bloated code. My code for assignment 2 is bloated like crazy. What I mean by bloated is that there is too many lines of codes. There are so many helper functions that it is making my head spin. I wish I had my partners so that perhaps I could have worked on it. But I do not have enough time and will have to hand in what I have.

If my program had been at its most efficient it would only be using one function but I guess I am not that good of programmer at the current moment to quickly come up with the best possible code.

But on the bright side this assignment once again got me to think really really hard. I learned new
tricks in python that I either did not know or was too lazy to know.

One such trick was a string method.
If you want to put a variable or an output inside a string here is how you do it:

example: A function f(x) return the number of hours you need to study give the course load x.

If I want to express the output in a string I can use this great method..
return 'I have to work {} hours'.format(what ever the output should be)

I always saw everyone else using this method but never tried it myself. But when I have
such a difficult assignment such as this I start getting practice on methods I would not normally use.
Now that I have practice in that method above I cannot live without it when coding in python.