2015年3月31日星期二

slogs for week 11: revisit previous slogs.

I revisit the slog for week 8. I mentioned that I had struggled with doing assignment 2 and especially described the details modification of "current_score" function. I made a complaint that this assignment costed me large amount of time because I adjusted the code for almost half a day due to just one mistake. I even said in the slogs for week 9 that I am frightened when I am debugging.

However, when I finished the assignment 3 this week, I realized that searching the problems I met in the website could help a lot because many people provided a solution to your questions online. In fact, for the assignment 3, we didn't know how to control the number of characters under 80 meanwhile passing the doctest.It seemed that there would be another half day to think about this question. At this time, my classmates reminded me that I could search "normalize white space" on the Internet. When I did as he said, I found it really helpful and there was a explicit solution to my question on the website. Therefore, I was aware that I probably could not solve this problem if I think by myself. Through this issue, I deeply understand that I should know the importance of looking for help on the Internet. This approach is convenient and effective.

Through this experience, my "debugging" phobia has been somehow relieved. This is the major change of my thought. Previously I regarded debug as a miserable experience. But for now, as I have got some approaches, I feel much more confident when I am debugging.

The last but not the least, when I am doing assignments with my partner, his mind affects me a lot and many ideas he came up with is really instructive. As he has enriched experience in coding JAVA and C, I learned a lot by working with him. Usually, he could answer almost all my questions and broaden my horizon. For now, I have studied many techniques and tricks which are not introduced in csc108 and csc148 about python. Hence, I feel really grateful to my partner and I am really satisfied with the process of learning csc148 this semester.   

  

         

2015年3月30日星期一

slogs for week 10

For this week, not many materials introduced in the lecture. The "assertion" is not a strange thing for me because such "assert except..." statement is already used in the solution of previous labs. So for this week, there is not much work load.

In addition, I find assignment 3 easier than the two previous assignments because I have already thought about the questions presented by assignment 3 instruction while I was doing assignment 2. When I was struggling with finishing minimax strategy, I found that minimax is kind of "repetitive" and "redundant". Minimax starts with base case and includes many repetitive cases. In order to avoid double counting, pruning and updating is necessary.

For the lab of this week, debugging is mentioned in the last section. As a matter of fact, I am really scared of debugging because it is really time-consuming and sometimes it is even nearly impossible to find the bug.Therefore, when I take programming course, I am always worried about the coding homework. In the coming summer vacation and next semester, I will focus on improving coding skills and doing more exercise so that I could overcome "debugging" phobia.

In conclusion, this week I can have a rest in studying csc148. However, coding practice is continuing.

 
   

2015年3月18日星期三

slogs for week 9: Term test 2

For this week, the only task is taking Term Test 2. I spent three full days preparing for this test from Sunday to Tuesday because I must improve my recursion coding skills. 

I prepared for this test mainly by doing previous labs. There are still many questions I have not solved. Initially, just as I mentioned in the last slog, I could not handle the recursion problem fluently and I must thoroughly trace the function otherwise I cannot come up with a solution. However, when I asked a second-year student for a solution, he could always quickly solve the questions, which really shocked me. I asked him how I can figure out the solution as quickly as possible. He said "You don't need to trace the recursion. You just need to think about one tree or plus a sub-tree. To put it another way, you can solve most recursion problems within one or two steps." After three-day practice, I finally comprehend his words. Furthermore, in csc240 course, I have learned the proof of recursive algorithm at the same time. Under the guidance of this course, I found that recursion in mathematical expression is induction. Therefore, I grasped the key to recursion. Every time when I solve a recursion, I only need to think about the equivalent induction. Induction is the reason why we only need to take one or two recursive steps into consideration. It just simply repeats same calls every time. So we are only required to find different complete cases for each time.

Luckily, I got a good test on Wednesday. As most coding problems in the exam are variant versions of lab questions, I solved all of them rapidly.  

      

slogs for week 8: linkedlist and assignment 2

This week, we have learned a new data structure --- linked list. Generally speaking, this data structure is not related to recursion. As linked list is a linear structure, it is much easier than binary tree structure. For this section, we have learned the new concept --- pointer, aiming at mutating the corresponding linked list.

At the very beginning, I cannot understand what cur_node and lnk.front really are. Sometimes, I am just not able to distinguish them and use them correctly. Fortunately, after doing the lab of this week, I eventually understand what they are and I can solve almost all the questions in this lab.

The most challenging task this week is assignment 2. The minimax strategy is really complicated and we almost gave up when we were designing the program. Finally, thanks to the instructor TA, we finally come up with a solution. In addition, we also met a lot of other difficult challenges when we were testing the program. For example, we modified the "current_score" function for multiple times because it cannot output the correct current score. However, we cannot find the flaw of the algorithm until we changed one variable "self.player" into "self.next_player". By accident, we got the correct version of this algorithm. Based on our modification, we traced the algorithm back and finally knew why we understood the recursion in a false way.In short, this assignment is really hard and really time-consuming.

Now, the next challenging task is coming next week --- term test 2. I feel really diffident because I still cannot handle the recursion problems fluently. In fact, when I am doing a little more complicated recursion problem, I still need to trace the function otherwise I cannot fully understand the question and where I need to modify. Therefore, I must improve my recursion coding skills in few days.

    
 

slogs for week 7: Recursion and object-oriented programming and abstract data structures

Last week, we learned binary tree and binary search tree. Same with week 6, I still cannot finish lab questions,but the good news is my recursion coding skills has improved distinctively. As a result, I am able to use recursion to solve one of the functions in assignment 2 called "current_score".

When I am doing the assignment 2, I get a much deeper understanding of object-oriented programming. In fact, before this assignment, even though professor said a lot about what "object-oriented" is, I still could not grasp the key to this concept. However, after doing this assignment and discussing with fellow students, I could finally be able to simplify this concept. Python and Java is object-oriented languages. When using these two languages, we usually write class such as: class tree, class stack and etc. Especially for Java, we could only write class by using java while python could also accept independent blocks of functions.

CSC148 has introduced multiple simple abstract data structures so far. Tree, binary tree, binary search tree and etc. I especially want to talk about the binary tree in details. Binary tree is a recursive structure, which has a left tree and right tree. Tree-list and class are two effective ways to represent tree structure.



Reference: http://bit.ly/1MLcaEu 

2015年3月2日星期一

slogs for week 6: learning tree structure this week

In this week, professor introduced a new data structure---tree. We learned to use basic recursion coding skills to solve relevant tree questions. When I was doing the lab for week six, I find it hard to solve all of those questions. For me, I could only finish half of the tasks. Therefore, I hope professor or TA could post the solution to all the lab questions.

When it comes to lab, I must say that I think there might be something wrong with the quiz. The quiz requires me to write code for counting leaves of a certain tree. However, the example it provided is probably wrong because one of the value it returned is not the number of leaves. Hence, this problem makes me so confused that I could not find a way to add the "redundant one" to the final result. 

I think tree structure really improved my recursion coding skills. Because it is a kind of application of recursion. However, I am not very confident about this new material because I just cannot finish the lab questions. The level of quiz questions seems more suitable for me (crying). For now, I could only consult fellow students for those questions, but it really makes me struggling and consulting is really time consuming. I hope I can find another way to solve this tricky problem in the coming weeks.

Generally speaking, I learned something interesting and made some enhancement this week.