Sunday, March 29, 2015

Week 11: Revisiting an Earlier SLOG Post

I want to revisit my Week 5 post which is about recursion. First of all, I just want to say that I can't believe that the term is almost over and Week 5 seems like a long long time ago. I remember how we took it very slow at first, just tracing recursion on paper before even writing any code. And when we did write code, Professor Heap guided us step by step through the exercises. Because of all this, I now feel more comfortable reading and writing recursive code than I was back then. 

Furthermore, all the extra exercises and lab work I've done then since then has really proved to me the importance of establishing the base case of recursive code. As I read through this slogger's post, I found that we kind of tackle problems in the same way. We feel more comfortable in writing recursive code once we're confident that the function handles the base case correctly.We also try to break down complex problems into smaller pieces by implementing helper functions. I've done this in my Assignments and I find it very helpful especially when debugging code.

Overall, I guess I would have to say that I agree with my earlier post. The difference now is that I've seen more applications of recursion, so I can appreciate it even more. 

Sunday, March 22, 2015

Week 10: Impressions of Week 9

We did not really have much lecture time for week 9 as Term Test 2 occurred during this week. Professor Heap mainly talked more about the Binary Search Tree and its insert and delete method. Deleting a node was a bit more complicated because we had to think about what should happen with the tree depending on whether or not the node had a right child, a left child or both children. This needed to be given some thought in order to preserve the BST condition after deleting a certain node. 

On Wednesday, Term Test 2 proceeded normally even with the strike still going on. Although, I do wish we had our labs back because it's a bit confusing to do the lab exercises without the TA. I think it's been three weeks now since the strike began and I hope it ends soon. 

Saturday, March 14, 2015

Week 9: Impressions of Week 8

When considering to use a certain data structure, we consider its properties and evaluate whether or not it fits our needs. For example, I think of the Binary Search Tree when I think of sorting integers because of its efficiency. I can see its advantages over the list data structure. However, I'm not quite sure when to use Linked Lists. I don't think we've discussed its applications or advantages in class yet. This is something I would like to know more about.

On another note, assignment 2 was also due on week 8. It was definitely more complicated than the first assignment. My partner and I decided to implement the Minimax algorithm first and test it on Subtract Square. Only after finishing that did we move on to implementing the game Tippy. When we finally completed the game, we played a 3x3 board with a computer running Minimax. It always won whenever it made the first move! I felt ecstatic! I was never so happy to lose! It meant the code worked!    

Thursday, March 5, 2015

Week 8: Linked Lists

This week, we set aside recursion for a moment to give way to a new topic: Linked Lists! Basically, a linked list structure is made up of nodes that have a value and a reference to other nodes. The concept of objects (in this case nodes) pointing to other objects was very similar to how Trees worked.

In order to better understand how this data structure worked, I found it really helpful to draw out the nodes and arrows in the proper order. This technique was very helpful when I attempted to do the lab exercises. There were moments when I was really stuck, and drawing the picture bailed me out. By being able to see the linked list structure, I was able to figure out the right sequence in setting or resetting its attributes.

This week was also the first week that TAs went on strike. I understand where they are coming from, and I truly hope an agreement can be reached soon for the benefit of everyone.