This
week we didn't learn about anything since monday was thanksgiving and we had
midterm on Wednesday. The midterm was okay in terms of difficulty but the sad
thing is since I skipped CSC108 I am not familiar with how some of the
functions run. For example, I got the first question completely wrong because I
thought the minimum of a list of tuples will give you the tuple with the least
element but after the midterm I realized that it gives you the tuple with the
least first element and if the first is the same for some it looks at the
second. I need to work harder with familiarizing myself with python, though I
do feel more confident now after several weeks of practice. I should read
documentations more often. Moreover, I find the exercise this week incredibly
fun. This is the hardest exercise so far and I really enjoyed doing it. Before
the exercise I already knew quite well the difference between the three
traversals, however I never thought building the original tree from the
traversals would be way harder from the other way around, since you don't have
a clear sense of division between the root and the left subtree and the right
subtree now that everything is in one list. But with two traversals you can find
the root from one then the left and right from the other and keep using
recursion to order everything. I also remembered to handle the exceptional
cases where the left or right subtree is none. I felt a great sense of
accomplishment after I finished it, and part b is just a piece of cake compared
to a. This whole concept of trees make me reflect on some of the most
interesting topics I learned in java. I find trees very different from what
we've learned so far since it is not actually a built-in class. It is a useful
concept defined by convention. When I studied java before I felt like searching
and sorting was very interesting since it was pure logic and there was no
existing resource at all, just like trees in python.
No comments:
Post a Comment