Sunday 15 February 2015

Trees and Branches

First of all, getting those midterm marks back was a bit scary I'd say. The first one is honestly always the worst one for me because it sets the pace for the rest of the semester. So I guess it's a good thing I didn't do bad on this midterm. The class average is in the high 70's though, and I think that's a pretty decent mark for us all to be averaging around.

Now getting back to the more important stuff, the implementation of recursion in data structures, namely Trees. To be fair, I did learn the basics of this in high school comp sc so I can't really tell how difficult a concept this is right now for everyone to grasp, but I feel like it's not that terrible. The whole idea behind recursion is to break down a problem into smaller versions of itself and that is exactly how we apply it to trees. Break the branches down till all you have left are trees with just one single node. The terminology involved with trees is a bit more confusing than I thought it would be, with arity and branching factor, and the height and the depth but I think it'll become pretty clear after a while of working with trees. 

Sunday 8 February 2015

Midterm + Recursion

First midterm done, I think we all deserve a pat on the back. To be honest, I had not expected such a detailed class construction for the first question, but then again when I finished it I realized it wasn't too bad. The only problem I had was finding enough time to complete the paper. I DID complete it, don't worry, but it was a bit of a rush at the end. The designing threw me off a bit and I don't really think that the time we had was enough to do all the question well, especially if we got stuck on one question or one part. Basically, what I'm trying to say here is that there wasn't too much time to think, you had to write it all down pretty fast.

Midterm aside, the topic we're at now is one of my favourite, because lets face it, the power of Recursion is pretty darn awesome. Its 10 lines of code fitted in just half or less of the space. Pretty mind blowing. And calling upon a function form with itself!? What! That's like inception right there. I wrote a bit about this in my last post too and I'm pretty sure I just repeated some of the stuff I said there. Nevertheless, now that we've understood the power of recursions we're also supposed to use it in our assignments and labs. That was something I forgot to do this lab because I'm not really used to coding recursively all the time. But I guess it's just a habit we all will have to get ourselves into because recursion is just that bad ass.