Sunday, 9 March 2014

Week 8

Week 8

Eight weeks into the class means two thirds of the course is finished! Since there is no assigned topic, I will write this in my usual format. This week, there were two main topics, linked lists and binary search trees. Linked lists were reviewed last week, but this week, they were implemented differently by using a wrapper and a helper. A wrapper and helper are essentially two parts of one function in that the helper does one part of the function, while the wrapper calls the helper and completes the function. As a result, only the wrapper is called directly, and the helper is called when the wrapper is implemented. Having learned this, I can see how it would be useful as it makes the program easier to follow. The other topic of the week was binary search trees. A binary tree is like the trees we have been reviewing, but what is special about these is that they only have two children per node. A string method was written in class, showing the use of wrapper and helper methods.

Outside of the lecture, I worked on the lab, assignment two part one, and exercise three. This lab dealt with linked lists like last week. After working through this lab, I feel much more secure about linked lists than I did last week. I felt that I was better able to understand what I was supposed to do and why I was supposed to do it. The second thing I worked on was A2 part 1. With this, I had several designs and could not decide which I thought was the best. So, after several changes and adjustments, I think I have something I think is okay (and I hope the grader thinks so too). Last, I worked on and finished exercise three early so I have many opportunities to get autograder feedback before the due date. I thought this exercise was harder than the first two, and I had to spend much more time thinking about how to solve the problem than I thought I would. I also had to draw some pictures, which is something that was not necessary for the first two exercises.

The first SLOG I picked to read is http://confabulatingastringofcontrivances148.blogspot.ca/. This log begins with the quote “In order to understand recursion, one must first understand recursion.” I thought this quote was humorous in that not only is the quote itself recursive, but it doesn't help someone who is trying to understand recursion that much. One thing this person wrote was “How can we write our function in a way to use a value, before we even know what the value is going to be?”. He/she was describing a source of confusion many people have when first learning recursion. I can relate to this, as I actually wrote about having the same thought in my own slog entry on recursion. The rest of the slog is a straightforward example on how to solve a recursive problem, (and has an interesting name). The second slog I picked is http://everyonelovesaslog.blogspot.ca/. This log mentioned the Fibonacci sequence, something I also mentioned in my recursion entry. The slog also mentions that in order to write a recursive function, one must know the base case. I think this is true, as when I write recursive functions, the first part I write is the base case. That way, once I know that my function does, I can build from that with the recursive calls.

No comments:

Post a Comment