Sunday, 13 March 2016

Week 8


This week was the final week before our second midterm and I am feeling more and more anxious about it! I really want to redeem myself but I am still not confident in my skills. I find the concept of binary trees and traversals confusing so I have some reviewing to do. However, I do feel confident about the concepts of the general tree, as I worked through all the functions/methods in the additional exercises of this week's lab. The only thing I had difficulties with was the levelorder_visit function. But after Professor Danny Heap went over the levelorder_visit function for binary trees, I knew how to implement the function for the general Tree class.

I spent the majority of this week working on Assignment 2. I've worked out most of my code for the puzzles, but I am stumped on how to implement the depth_first_solve and breadth_first_solve functions. I think the problem is that I don't quite understand how to utilize the PuzzleNode class. There is a puzzle parameter and a children parameter, which I understand, but I don't know what the purpose of the parent parameter is. I'm also confused why the parent parameter is behind the children parameter. At the moment, all I'm sure is that the depth_first_solve function travels through the puzzle tree in preorder, while breadth_first_solve travels in level order.

I would say the week ended off on a good note with the lab. I found it very easy, which I hope means that I have been improving on my recursion skills. I'm also very happy with my Assignment 1 mark, so hopefully things will only get better from here on out.

See you next week and good luck to everyone on the midterm!

No comments:

Post a Comment