This
week we continued to learn about binary trees and nodes and how to implement a
tree using a linked list. I have studied linked list before and it was pretty
much the same in java as in python. I find linked list very convenient because
we only need one instance variable to represent the whole list. The exercise
this week was a little painful for me since I kept misunderstanding the
instructions and I also forgot to check what internals and leaves referred to,
so that I always got errors reported from markus. It was a pretty fun exercise,
though it did waste me a long time correcting my stupid mistakes, and it wasn't
as hard as last week's which I really enjoyed. However, I did start doing the
assignment this week and find it very intriguing. I always like case studies and
classes that are not built in such as the grid world case study from eclipse. I
think this way it would compel us to think more comprehensively and diligently
since there are no convenient library methods ready for use. And this
assignment is another typical example of a logical problem that does not
require much code. I finished the first part but I'm still stuck on the second
because I just can't figure out how to check the RegexTree from the bottom up
and how to reference to the corresponding characters in the string. I already
drew a detailed tree and analyzed different scenarios but I still can't solve
it. I want to leave it for now and maybe ask the professor next week. I feel
pretty confident about the material covered this week because I think I have a
pretty good logic but not a very good memory, so binary tree is fairly easy to
me. The lab this week was also about linked lists which I found no difficulty
in. This week I also received my grade for the first assignment and I received
a 70 something with a class average of 60 something. I have to say that the
grading was pretty harsh since it was already very hard for me to finish
everything and make it work while looking at the rubric I saw that you would
only get half the credit if you just finish it. I find that unreasonable since
not everybody can think in a concise and efficient way now that we are just
beginning to program and as long as I was not hardcoding I should get a higher
grade. But I did enjoy the assignment a lot and this rubric prompts me to be
more efficient in writing code. I recall the exercise last week where I used
the maximum of a list of tuples in a list comprehension and feel like I am able
to write efficient code already. It's just that large assignments are more
daunting so that I can't really think of brevity. I need to pratice and think
more about which algorithm is the most efficient. I read the blog by bearw on http://obiwanslog.blogspot.ca/
and felt the same way as he did. I, too, spent a long time debugging because
there was just too much to implement but when I got to tour of Anne Hoy and
SolvingController it flowed really quickly because I was immersed in the fun of
logical thinking. The last part required a lot of thinking and little coding.
Is there any previous code you've written that you would now have written using a linked list?
ReplyDeleteI think every list can pretty much be represented using a linked list. However, even though linked lists are very easy to represent they do have a huge drawback which is that you have to be able to access the head of the list if you want to operate on it otherwise you wouldn't know the position of a linked list object. So lists and linked lists both have advantages and disadvantages and I would choose which one to use according to the situation.
Delete