Sunday, February 16, 2014

week_6 Binary Tree

It's been a tiring week right before reading week with 2 midterms and a few quizzes to write and assignments awaits to due. Life just sucks sometimes, but it goes on and on without stopping, and I can do nothing with it, especially when I have 3 more midterms to write right after reading week.

This week we've been talking about this binary tree stuff the whole time, which is exactly the same thing we've been working on in CSC240. I guess it's gonna be quiet important point might be checked on midterm. There's really nothing I find worth mentioning in this slog coz it's just like comprehending  and memorizing. I must admit this tree is quiet magic. It can be expressed as a class in Python and we can get to every node in 3 different orders, which makes me thinking about organization of datas. Also, recursive has been used in almost every method like counting leaves. This tree must be quiet handy someday in the near future, midterm for instance.

Labs has always gone quiet smooth though, which is good. And I finally learned how to write a unit test in the right form.

Recently I feel like I weren't a CS guy but a math guy, which is weird. But I'm gonna stick on to CS I think. I've been thinking about taking summer courses, but is it sufficient to grasp all the stuff in a shorter time? I would go for some language classes rather than spend the whole summer typing code indoors, I suppose.






week_5 More recursive

This week we've seen more examples in recursive, among which, move_cheeese has been a great help to A1, where we're supposed to do a more complex one with 4 pegs rather than 3.( I decide never to start that late ever again! ) It took me quiet some time to figure out how it works and I found stuffs like recursive sometimes give me a hard time tracing them in my head. I tended to do all the things, i.e. finding best split point and getting all move sequence possible all in one function, which turned out a bad idea and thus I got stuck for, like 2 days, trying to figure out how n-k works for the case where n-k < n. But when I wrote a function computing best k, it's no longer a problem.

 Though I've been learning recursive for the past 2 weeks, it's still kinda challenging to figure out the best code using recursive. What's more, I really don't get it why those codes shown in class always have only one long, subtle sentence for the function body. Whatever, it's really not clear enough for me and I personally prefer not writing a full sentence.

Monday, February 3, 2014

week_4 A little taste of recursion

Week four has past and we've seen many examples of recursion like turtle. In fact, it's just like calling your function inside this function. This way of recursive seemed a little weird to me at first since I feel like I would fall into an infinite loop and errors occur. But it turned out that it was not difficult to trace it by hand and I got a general idea of using my functions wisely.  Those examples showed in class were very enlightening and I found Turtle especially beautiful. I really hope we can do more like this and so far I found CSC148 much more detailed in designing, actually I started to feel like I'm   learning computer science rather than simply learning a computer language. Even though, I would like to grasp more computer languages to expand my thoughts as well.

I still don't get any general idea of my future study in Computer Science mapped out since I'm not sure where my interests are..... Just feeling confused these days, but anyway........