Saturday, March 15, 2014

Week 9: Binary Search Tree and Wrapper Functions



It is a busy time right now for us in CSC148, with exercise three and assignment two due soon, as well as the second midterm coming up. Luckily, I was able to race past the first two recently, added the finishing touch to assignment two part two just this afternoon, giving me a cushion to review the various types of tree structure.

First of all I would like to note about this week’s lab session, which had the tedious tasks of creating the same function in four different ways. Although stressful at time, it was a great learning experience. After nine weeks in the course, I am very comfortable with thinking and programming recursively, so the first three parts was a breeze once I have gotten the right idea. For the last part, me and my partner Brian were stuck on it for quite a while, when we realized that we only had 10 minutes left in the lab, he hinted me with an ingenious idea that can be considered as thinking well outside the box. The brief solution can be seen from Brian’s slog here: http://my148slog.blogspot.ca/2014/03/brians-csc148-slog-9.html

This lab also gave us an opportunity to practice with these wrapper functions. I am still not completely comfortable with the concept of a wrapper function at the moment, but I definitely have a greater understanding of it. A fellow classmate also mentioned this on his slog (http://compscislog.wordpress.com/) where he noted that it helps to make calls less prone to error. This I noticed in the lab when calling from _BSTNode and _BSTNone which was convenient at times with self.left and self.right in these wrapper functions but not in the original BST module.

I was able to finish the assignment 2 part 2 today after a considerable amount of theory-crafting along with trial and error. Piazza was very useful in the completion of this as well as other students were able to give me important hints in the breaking up of a function into smaller problems. It was definitely a great challenge, even though I felt more at ease with this assignment than the first, possibly just because I am more adapt at solving these recursive problems now. Anyway, this is a great week for me in terms of accomplishment; I’ll be back next week with a full report on assignment two.

No comments:

Post a Comment