This week, I will revisit my Slog from Week 4. During Week 4, we were to write about our impressions of the first 3 weeks. In that post, I complained about how about half of each class was getting devoted to answering student questions regarding the first assignment. I agree that it is certainly a bit annoying to use most of class time to answer similar questions that were asked on Piazza. However, I also disagree to certain aspects of it. For both assignment 2 and 3, I have found the questions and answers to be much more helpful, especially when the professor includes slides to help answer common questions asked on Piazza. I suppose my original stance on this was different because I was not very into assignment 1. My group started assignment 1 late and it was generally simple. However, as the concepts gets more complex, assistance like this in class is no doubt helpful.
In Slog #9 by theCStist, they write about how they used to write code by trying a bunch of different things until it ended up working but now they take it step by step, starting with some examples. I find that this is basically what I was initially doing for the more complex recursive functions. I admit that sometimes I still do this. However, when the code does run, I try to go over the completed code and add comments to describe what I did there to help myself understand what I just did.
Friday, March 27, 2015
Saturday, March 21, 2015
Impressions of Week 9 (Week 10)
Last week, we wrote our second term test. I found the test to be straightforward and average in difficulty. Like before, studying the lab exercises and especially the additional exercises proves to be one of the most useful thing one can do in preparing for these tests. One thing I really didn't like was that the test took place so early at 9am for Diane's section.
During this week, we learned about mutating binary search trees. Although we got a short lab for it, I didn't bother doing it until after the test. And even after the test, it wasn't until week 10 that I really attempted it. Without having a lab to attend, doing these at home doesn't feel like it has much priority.
In this post, Jason writes that handwriting code is not a very good way of evaluating a student's skills in writing code as it results in a lot of careless mistakes. I agree that having tests be 100% hand written code is not the best way to evaluate people and in many cases, typing code does not directly translate into being able to hand write the code. Thus, when preparing for tests like these, students including myself will have to find alternate ways to prepare for the test including writing a bunch of practice code by hand. However, I find that it may be difficult to find an alternative to this as allowing students to write code on a computer will easily allow cheating. Furthermore, it would force every student to bring a laptop or the professors would have to somehow provide hundreds of computers, both of which are unrealistic scenarios.
During this week, we learned about mutating binary search trees. Although we got a short lab for it, I didn't bother doing it until after the test. And even after the test, it wasn't until week 10 that I really attempted it. Without having a lab to attend, doing these at home doesn't feel like it has much priority.
In this post, Jason writes that handwriting code is not a very good way of evaluating a student's skills in writing code as it results in a lot of careless mistakes. I agree that having tests be 100% hand written code is not the best way to evaluate people and in many cases, typing code does not directly translate into being able to hand write the code. Thus, when preparing for tests like these, students including myself will have to find alternate ways to prepare for the test including writing a bunch of practice code by hand. However, I find that it may be difficult to find an alternative to this as allowing students to write code on a computer will easily allow cheating. Furthermore, it would force every student to bring a laptop or the professors would have to somehow provide hundreds of computers, both of which are unrealistic scenarios.
Friday, March 13, 2015
Impressions of Week 8 [Linked Lists] (Week 9)
I found the idea of linked list to be a bit more easy to wrap my head around than the trees from the previous weeks. Mainly because it's linear, in the sense that the data do not keep spreading out. The data in a linked list is similar to cargo in a freight train, each node contains some stuff then contains the link to the next node.
When I looked over the code of the already implemented functions in the lab, I noticed that many of them has a similar segment of code which is used to traverse through it. Seeing this, I went back to the lecture slides and found that there was a page on walking through a linked list. I guess I must have missed this slide during class. You walk through a linked list by having a variable cur_node refer to the front. Then in a while loop structure, we do some stuff then set cur_node to cur_node.nxt.
This was the first lab exercise that we didn't get a chance to go into tutorial and get assistance from a TA. Since I didn't have my lab on Thursday this week, I sort of slacked off on the lab exercise. Once I did get to it, I was able to implement a few functions without a problem but then I ran into trouble with insert_before and delete_after. After trying some random stuff, I gave up and looked through the solutions. Although the solutions did help, I felt like I would have understood more if I was able to work through it myself after some feedback. However, I should probably only blame myself since I slacked off this week. I will try harder next week and refrain from blaming the strike for my lowered motivation to do lab work.
When I looked over the code of the already implemented functions in the lab, I noticed that many of them has a similar segment of code which is used to traverse through it. Seeing this, I went back to the lecture slides and found that there was a page on walking through a linked list. I guess I must have missed this slide during class. You walk through a linked list by having a variable cur_node refer to the front. Then in a while loop structure, we do some stuff then set cur_node to cur_node.nxt.
This was the first lab exercise that we didn't get a chance to go into tutorial and get assistance from a TA. Since I didn't have my lab on Thursday this week, I sort of slacked off on the lab exercise. Once I did get to it, I was able to implement a few functions without a problem but then I ran into trouble with insert_before and delete_after. After trying some random stuff, I gave up and looked through the solutions. Although the solutions did help, I felt like I would have understood more if I was able to work through it myself after some feedback. However, I should probably only blame myself since I slacked off this week. I will try harder next week and refrain from blaming the strike for my lowered motivation to do lab work.
Sunday, March 8, 2015
Impressions of Week 7 [Binary Trees] (Week 8)
During week 7, we learned about linked structures, using the class BTNode as the example. A binary tree (BT) is subcategory of trees. While a root in a tree structure may have infinitely many childrens, all contained within a list, a root in a binary tree may have up to two children. One of the examples we examined that made use of a binary tree was binary arithmetic expressions. Each of its root contains a "data" that can be used to evaluate its two children. For example, a root with '+', left node '3', and right node '4' would represent '3+4'. A more complex case would require recursion. Such as one with a root '+', left node '*', right node '7'. The left node (now the root), has a left node '3' and right node '4'. In order for this binary tree to make sense, each child node that also has children must evaluate its children and return the evaluated value up the tree so that its parent may evaluate that value. Doing this we would represent the expression '(3*4)+7', with the '(3*4)' evaluated first and returned as the left node. The final evaluation would look like '12+7'.
I didn't really get what preorder, inorder, and postorder was about. I will try to review them in the future. I found the idea of binary search trees to be rather convenient and interesting.
The parenthesize function in the lab was almost identical to the evaluate function we developed in class. I actually found this to be helpful in solidifying my understanding of recursion using binary trees. I found list_between and list_internal_between to be extremely difficult. I ran out of time during the lab to finish it, and decided to give up on it for the time being.
Coming back to this, I finally figured out what I was doing wrong in list_between and list_internal_between. My biggest mistake was to trying to implement the else block in one line like I did for every other recursive function. This has expanded my view on implementing recursive functions. I had always tried to stick to a single line per if, elif, and else for recursion because recursively calling the function would reset any sort of setting, counters and the likes in the function.
Having learned this, I think that I should try more ways to implement recursive functions, even if I initially think they are wrong. If I try enough ways to implement one, I will learn something from it even if I fail to correctly implement it the first few times.
I didn't really get what preorder, inorder, and postorder was about. I will try to review them in the future. I found the idea of binary search trees to be rather convenient and interesting.
The parenthesize function in the lab was almost identical to the evaluate function we developed in class. I actually found this to be helpful in solidifying my understanding of recursion using binary trees. I found list_between and list_internal_between to be extremely difficult. I ran out of time during the lab to finish it, and decided to give up on it for the time being.
Coming back to this, I finally figured out what I was doing wrong in list_between and list_internal_between. My biggest mistake was to trying to implement the else block in one line like I did for every other recursive function. This has expanded my view on implementing recursive functions. I had always tried to stick to a single line per if, elif, and else for recursion because recursively calling the function would reset any sort of setting, counters and the likes in the function.
Having learned this, I think that I should try more ways to implement recursive functions, even if I initially think they are wrong. If I try enough ways to implement one, I will learn something from it even if I fail to correctly implement it the first few times.
Sunday, March 1, 2015
Subscribe to:
Posts (Atom)